-
Notifications
You must be signed in to change notification settings - Fork 13
ULID
STATUS: ACTIVE
This class implements the ULID spec in Apex. You can find that standard here: https://github.com/ulid/spec ULID === Universally Unique Lexicographically Sortable Identifier Think of them as a UUIDv4, but sortable. Similar to UUIDv7. These are, effectively a universally unique identifier but one that is sortable. This class is a port of the Javascript ULID reference implementation.
This character set is the complete list of allowed characters in a ULID string. It intentionally does not include characters that may be ambiguously read, such as i, l, o, and u characters.
Generates a ULID string according to spec. https://github.com/ulid/spec
Type | Description |
---|---|
String | String |
Encodes a given timestamp into characters from the acceptable character set above.
Param | Description |
---|---|
dtSeed |
long form of Timestamp to encode |
timeLength |
how many characters of the timestamp to encode |
Type | Description |
---|---|
String | String |
generates a random string from the character set of a given length.
Param | Description |
---|---|
length |
Integer length of the string to generate |
Type | Description |
---|---|
String | String |
pulls a random character from the character set.
Type | Description |
---|---|
String | String |