ULID

com.bilalfazlani.zioUlid.ULID$
See theULID companion class
object ULID

Attributes

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

Members list

Value members

Concrete methods

def apply(ulidString: String): Either[ULIDStringParsingError, ULID]

Creates a ULID from a string. Performs string length validation, character validation, and overflow validation.

Creates a ULID from a string. Performs string length validation, character validation, and overflow validation.

Attributes

Returns

If string is valid, returns Right(ULID), otherwise returns Left(ULIDStringParsingError)

def apply(timestamp: Long, randomBytes: Chunk[Byte]): Either[ULIDBytesParsingError, ULID]

Creates a ULID from a timestamp and random bytes. Performs timestamp validation and random bytes size validation

Creates a ULID from a timestamp and random bytes. Performs timestamp validation and random bytes size validation

Value parameters

randomBytes

Chunk (of size 10) of random bytes

timestamp

Timestamp in unix (epoch) milliseconds. Should be less than 281474976710655L

Attributes

Returns

If timestamp and random bytes are valid, returns Right(ULID), otherwise returns Left(ULIDBytesParsingError)

def apply(allBytes: Chunk[Byte]): Either[InvalidBytesLength, ULID]
def apply(high: Long, low: Long): ULID
def nextULID: URIO[ULIDGen, ULID]

generates a new random ULID

generates a new random ULID

Attributes

Returns

a new random ULID

def unapply(ulid: String): Option[String]
def unapply(ulid: Chunk[Byte]): Option[String]