Search packages, repositories and app categories

Package detailsv1.1.0

sane_uuid

A sane UUID implementation with support for generating and handling v1, v4 and v5 UUIDs according to RFC4122.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
24.1K
Likes
4
Pub points
160

Install package

flutter pub add sane_uuid

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A clean and straightforward UUID library for Dart and Flutter, compliant with RFC4122. It supports generating and parsing version 1, 4, and 5 UUIDs with a simple, intuitive API. Designed to be reliable and easy to use across all major platforms, it ensures consistent UUID handling in applications requiring unique identifiers. The package emphasizes clarity and correctness without unnecessary complexity.

Use cases

  • Generating unique IDs for user sessions
  • Creating persistent identifiers in databases
  • Implementing secure token generation
  • Synchronizing data across devices
  • Handling UUIDs in cross-platform apps

Key features

  • Supports UUID versions 1, 4, and 5
  • RFC4122 compliant
  • Simple and readable API
  • Cross-platform compatibility
  • Robust parsing and validation
  • Lightweight and dependency-free

Suitable for

  • Apps needing unique identifiers
  • Backend services using UUIDs
  • Data synchronization features
  • Secure authentication systems
  • Multi-platform development

Considerations

  • Does not support UUID version 3
  • Limited to standard UUID formats
  • No built-in UUID validation utilities beyond parsing
  • Not designed for high-performance bulk UUID generation

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

sane_uuid

codecov

A properly designed, efficient UUID library for Dart.

  • Supports v1, v4, v5 and v6 generation
  • Immutable Uuid type with equality, comparison and accessors for properties defined by RFC 4122
    • The internal representation of the UUID is a byte array, not a String
  • Support for all syntactically correct UUIDs (regardless of RFC4122 semantics)

Usage

A simple usage example:

import 'package:sane_uuid/uuid.dart';

// randomly generated using secure random number generator
final Uuid randomUuid = Uuid.v4();
// Prints properly formatted UUID, e.g.: a8796ef4-8767-4cd0-b432-c5e93ba120df
print(randomUuid);

// parse any common UUID string
final parsedUuid = Uuid.fromString(
  'a8796ef4-8767-4cd0-b432-c5e93ba120df',
);

// hyphens and capitalization don't matter
final parsedUuidDifferentFormatting = Uuid.fromString(
    'A8796EF487674CD0B432C5E93BA120DF',
);

// UUID objects with the same data are actually equal
assert(parsedUuid == parsedUuidDifferentFormatting);

For more examples, see the examples page.

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

This project is released under the MIT License. That includes every file in this repository, unless explicitly stated otherwise at the top of a file. A copy of the license text can be found in the LICENSE file.

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.