ULID

wvlet.airframe.ulid.ULID$
See theULID companion class
object ULID

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).

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ULID.type

Members list

Concise view

Type members

Classlikes

class ULIDGenerator(random: () => Array[Byte])

ULID generator.

ULID generator.

Attributes

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())

Graph
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(ulidString: String): ULID

Create a new ULID from a given string of size 26

Create a new ULID from a given string of size 26

Attributes

The default secure random-based ULID Generator

The default secure random-based ULID Generator

Attributes

def fromBytes(bytes: Array[Byte]): ULID

Create a ne ULID from a byte sequence (16-bytes)

Create a ne ULID from a byte sequence (16-bytes)

Attributes

def fromBytes(bytes: Array[Byte], offset: Int): ULID

Create a ne ULID from a byte sequence (16-bytes)

Create a ne ULID from a byte sequence (16-bytes)

Attributes

def fromString(ulid: String): ULID

Create a new ULID from a given string of size 26

Create a new ULID from a given string of size 26

Attributes

def isValid(ulid: String): Boolean

check a given string is valid as ULID

check a given string is valid as ULID

Attributes

Create a new ULID

Create a new ULID

Attributes

def newULIDString: String

Create a new ULID string

Create a new ULID string

Attributes

Return a fast ULID generator, but with a reduced randomness

Return a fast ULID generator, but with a reduced randomness

Attributes

def of(unixTimeMillis: Long, randHi: Long, randLow: Long): ULID

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)

Attributes

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

def ofMillis(unixTimeMillis: Long): ULID

Create a new ULID from a given unix time in milli seconds

Create a new ULID from a given unix time in milli seconds

Attributes

def setDefaultULIDGenerator(newGenerator: ULIDGenerator): Unit

Set the default ULIDGenerator that will be used for ULID.newULID.

Set the default ULIDGenerator that will be used for ULID.newULID.

Attributes

def unapply(ulidString: String): Option[ULID]

Use the default secura-random based ULID generator.

Use the default secura-random based ULID generator.

Attributes

Use the fast ULID generator by default with reduced randomness

Use the fast ULID generator by default with reduced randomness

Attributes

Concrete fields