Installation
UUID v4
Generate and work with UUID version 4 identifiers.generateUuid4
Generates a new UUID v4 string.isUuid4Valid
Checks if a string is a valid UUID v4.getUuid4Bytes
Returns the byte array representation of a UUID v4 string.makeUuid4FromBytes
Constructs a UUID v4 string from a byte array.UUID constants
ULID
ULID (Universally Unique Lexicographically Sortable Identifier) combines the benefits of UUIDs with lexicographical sorting.ULIDs are 26 characters long and encode a timestamp, making them naturally sortable by creation time.
generateUlid
Generates a new ULID string.generateUlidList
Generates multiple ULIDs in a monotonically increasing sequence.isUlidValid
Checks if a string is a valid ULID.getUlidBytes
Returns the byte array representation of a ULID string.makeUlidFromBytes
Constructs a ULID string from a byte array.Types
UlidOptions
Options for generating ULIDs.Comparison: UUID vs ULID
- Features
- When to use UUID v4
- When to use ULID
Examples
- Database records
- Ordered events
- Batch generation
- Validation