class ULID::Factory

Direct Known Subclasses

Defined in:

ulid.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(random : Random = Random.new) #

[View source]

Instance Method Detail

def gen_rand(seed_time : Time) : UInt128 #

returns a random UInt128 with the high-order 48 bits zeroed out


[View source]
def gen_time(time : Time) : UInt64 #

returns a UInt64 with the high-order 16 bits zeroed out and the low-order 48 bits representing the number of milliseconds since Unix epoch


[View source]
def rand128 : UInt128 #

[View source]
def random : Random #

[View source]
def random=(random : Random) #

[View source]
def string(seed_time : Time = Time.utc) : String #

Generate a ULID

ULID.string
# => "01B3EAF48P97R8MP9WS6MHDTZ3"

[View source]
def uint(seed_time : Time = Time.utc) : UInt128 #

[View source]
def ulid(seed_time : Time = Time.utc) : ULID #

[View source]
def uuid(seed_time : Time = Time.utc) : UUID #

[View source]