Search packages, repositories and app categories

Package detailsv2.2.0

ulid

Lexicographically sortable, 128-bit identifier (UUID) with 48-bit timestamp and 80 random bits. Canonically encoded as a 26 character string, as opposed to the 36 character UUID.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
31.5K
Likes
56
Pub points
160

Install package

flutter pub add ulid

Package Overview

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

ULID is a 128-bit identifier that combines a 48-bit timestamp and 80 random bits, producing lexicographically sortable IDs. Encoded as a 26-character string, it offers a more compact alternative to standard UUIDs (36 characters). ULIDs are ideal for distributed systems requiring unique, time-ordered identifiers without relying on centralized coordination. The package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux.

Use cases

  • Distributed system identifiers
  • Time-ordered data tracking
  • Database primary keys
  • API request tracing
  • Secure session tokens
  • Log entry identification

Key features

  • Lexicographically sortable
  • Compact 26-character encoding
  • Built-in timestamp
  • High entropy with 80 random bits
  • Cross-platform support
  • No dependency on external services

Suitable for

  • Applications needing time-ordered uniqueness
  • Systems avoiding central ID generation
  • High-performance databases
  • Event sourcing architectures
  • Microservices with decentralized ID needs

Considerations

  • Not suitable for cryptographic secrets
  • Requires careful handling in high-frequency scenarios
  • Limited to 128-bit size constraints
  • Not universally supported in legacy systems
  • May require validation in strict compliance environments

Original README

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

Ulid implementation in Dart

Lexicographically sortable, 128-bit identifier (UUID) with 48-bit timestamp and 80 random bits. Canonically encoded as a 26 character string, as opposed to the 36 character UUID.

Original implementation: https://github.com/alizain/ulid/

Specification: https://github.com/ulid/spec

Usage

A simple usage example:

import 'package:ulid/ulid.dart';

void main() {
  print(Ulid());
  print(Ulid().toUuid());
  print(Ulid().toCanonical());
  print(Ulid().toBase32()); // uppercase, spec-aligned format
}

Links

Categories

Source repository

Projects using this package

Rankings