uuid
4.6.0, released 4 months ago by yuli.dev
Generates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
What it does
Provides functions to create version‑1,‑4,‑5,‑6,‑7 and‑8 UUIDs and to validate or parse 128‑bit hexadecimal strings. Works on all Dart platforms with cryptographically strong RNG by default.
AI-written summary of version 4.6.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need unique identifiers across devices or services
- You require support for newer UUID versions (v6‑v8) or strict RFC validation
Skip it when
- You need a UUID library with built‑in persistence or database integration
- You prefer a code‑gen based solution for IDs
Strengths
- Cryptographically strong random generation on all platforms
- Supports the full range of RFC‑4122 and RFC‑9562 versions
- Provides explicit format validation and parsing utilities
Weaknesses
- Only focuses on UUID generation/parsing – no storage or networking features
- No code‑generation helpers; you must call the API directly
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
import 'package:uuid/uuid.dart';
var uuid = Uuid();
print(uuid.v4()); // random UUID
print(uuid.v1()); // time‑based UUIDAlternatives
Packages that do the same job and could replace uuid.
- nanoid2
A tiny, secure, URL-friendly, unique string ID generator with a pure Dart API.
74Compare - uuid_type
Provides UUID parsing, generation (v1, v4, v5) and comparison for Dart.
59Compare - ulid
Lexicographically sortable 128-bit identifier generator.
78Compare - sane_uuid
A properly designed, efficient UUID library for Dart supporting v1, v4, v5, and v6 generation.
50Compare
Works with
Packages commonly used together with uuid: ones it builds on, ones built on it, and its own family.
- cryptouuid depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- fixnumuuid depends on itProvides 32‑ and 64‑bit signed fixed‑width integer types for Dart.
- flutter_cache_managerBuilt on uuidGeneric cache manager for saving web files and cache info on device storage.
- riverpodBuilt on uuidA reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
- sentryBuilt on uuidCrash reporting and error tracking library for Dart and Flutter applications.
- audioplayersBuilt on uuidA Flutter plugin to play multiple audio files simultaneously
- just_audioBuilt on uuidFeature‑rich audio player for Flutter supporting gapless playlists and multiple sources
- flutter_mapBuilt on uuidPure‑Flutter map client with tile loading, markers, and gestures