ULID

org.encalmo.models.ULID$package.ULID
object ULID extends OpaqueStringWithPattern[ULID, "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}"]

Attributes

Graph
Supertypes
trait OpaqueStringWithPattern[ULID, "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}"]
trait OpaqueString[ULID]
trait AutoShow[ULID, String]
trait OpaqueType[ULID, String]
class Object
trait Matchable
class Any
Show all
Self type
ULID.type

Members list

Type members

Classlikes

Base 32 encoding by Douglas Crockford: https://www.crockford.com/base32.html

Base 32 encoding by Douglas Crockford: https://www.crockford.com/base32.html

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
final class ULIDGenerator(random: () => Array[Byte])

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

Attributes

Supertypes
class Object
trait Matchable
class Any

Inherited classlikes

object given_Conversion_O_T extends Conversion[O, T]

Attributes

Inherited from:
AutoShow
Supertypes
class Conversion[O, T]
trait O => T
class Object
trait Matchable
class Any

Value members

Concrete methods

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
def isValid(ulid: String): Boolean

check a given string is valid as ULID

check a given string is valid as ULID

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)

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

Attributes

def randomULID(): ULID

Inherited methods

inline def apply(value: String): ULID

Attributes

Inherited from:
OpaqueStringWithPattern
def preformat(value: String): String

Attributes

Inherited from:
OpaqueStringWithPattern
inline def show(value: ULID): String

Attributes

Inherited from:
OpaqueStringWithPattern
inline def unapply(value: ULID): Option[String]

Attributes

Inherited from:
OpaqueType
inline def validate(value: String): Option[ULID]

Attributes

Inherited from:
OpaqueStringWithPattern

Concrete fields

val MaxTime: Long
val MaxValue: ULID
val MinTime: Long

Givens

Inherited givens

Attributes

Inherited from:
AutoShow
given given_Function_O_Value: ULID => Value

Attributes

Inherited from:
OpaqueString
given given_ReadWriter_O: ReadWriter[ULID]

Attributes

Inherited from:
OpaqueString

Extensions

Extensions

extension (ulid: ULID)
inline def randomness: (Long, Long)

Return 80-bits randomness value of this ULID using a pair of (Long (16-bit), Long (64-bit))

Return 80-bits randomness value of this ULID using a pair of (Long (16-bit), Long (64-bit))

Attributes

inline def timestamp: Long

Return 48-bit UNIX-time of this ULID in milliseconds

Return 48-bit UNIX-time of this ULID in milliseconds

Attributes

inline def toBytes: Array[Byte]

Get a 128-bit (16 byte) binary representation of this ULID.

Get a 128-bit (16 byte) binary representation of this ULID.

Attributes

inline def toInstant: Instant

Inherited extensions

extension (value: ULID)
inline def existsIn(values: ULID*): Boolean

Attributes

Inherited from:
OpaqueType