ULID generator implementation based on https://github.com/petitviolet/ulid4s
ULID has 128 bit value: |-- Unix timestamp milliseconds (48-bit) ---- | ----- random value (80 bits) ------ |
The string representation of ULID uses 26 characters in Crockford Base 32 representation, each character of which represents 5-bit value (0-31).
- Companion:
- class
Type members
Classlikes
ULID generator.
ULID generator.
- Value parameters:
- random
a function that returns a 80-bit random values in Array[Byte] (size:10)
- timeSource
a function that returns the current time in milliseconds (e.g. java.lang.System.currentTimeMillis())
Value members
Concrete methods
Return a fast ULID generator, but with a reduced randomness
Return a fast ULID generator, but with a reduced randomness
Create an ULID from a given timestamp (48-bit) and a random value (80-bit)
Create an ULID from a given timestamp (48-bit) and a random value (80-bit)
- Value parameters:
- randHi
16-bit hi-part of 80-bit random value
- randLow
64-bit low-part of 80-bit random value
- unixTimeMillis
48-bit unix time millis
Create a new ULID from a given unix time in milli seconds
Create a new ULID from a given unix time in milli seconds
Set the default ULIDGenerator that will be used for ULID.newULID.
Set the default ULIDGenerator that will be used for ULID.newULID.
Use the default secura-random based ULID generator.
Use the default secura-random based ULID generator.