class ULID::Factory
- ULID::Factory
- Reference
- Object
Direct Known Subclasses
Defined in:
ulid.crConstructors
Instance Method Summary
-
#gen_rand(seed_time : Time) : UInt128
returns a random UInt128 with the high-order 48 bits zeroed out
-
#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
- #rand128 : UInt128
- #random : Random
- #random=(random : Random)
-
#string(seed_time : Time = Time.utc) : String
Generate a ULID
- #uint(seed_time : Time = Time.utc) : UInt128
- #ulid(seed_time : Time = Time.utc) : ULID
- #uuid(seed_time : Time = Time.utc) : UUID
Constructor Detail
Instance Method Detail
def gen_rand(seed_time : Time) : UInt128
#
returns a random UInt128 with the high-order 48 bits zeroed out
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
def string(seed_time : Time = Time.utc) : String
#
Generate a ULID
ULID.string
# => "01B3EAF48P97R8MP9WS6MHDTZ3"