Skip to content
pubscout

sane_uuid

1.1.0, released 2 years ago by bjoernpetersen.net

A properly designed, efficient UUID library for Dart supporting v1, v4, v5, and v6 generation.

WASM-ready
$ flutter pub add sane_uuid
Source repository

What it does

Provides an immutable Uuid type with equality, comparison, and accessors for RFC-defined properties. It supports generating and parsing UUIDs using a byte array internal representation rather than strings.

AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to generate v1, v4, v5, or v6 UUIDs in Dart or Flutter
  • You want an immutable UUID object with proper equality and byte-array representation

Skip it when

  • You are already using a different fully-featured UUID package and don't need changes

Strengths

  • Internal representation uses byte arrays instead of strings for efficiency
  • Supports v1, v4, v5, and v6 UUID generation according to specifications
  • Immutable Uuid type with equality and comparison built-in

Weaknesses

  • Limited to UUID handling and generation

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
import 'package:sane_uuid/uuid.dart';

final Uuid randomUuid = Uuid.v4();
print(randomUuid);

final parsedUuid = Uuid.fromString(
  'a8796ef4-8767-4cd0-b432-c5e93ba120df',
);

Alternatives

Packages that do the same job and could replace sane_uuid.

  • uuid

    It is another popular package for generating and parsing UUIDs in Dart.

Works with

Packages commonly used together with sane_uuid: ones it builds on, ones built on it, and its own family.