class UUID::V7Factory

Defined in:

ulid.cr

Constant Summary

VARIANT_RFC4122 = 2_u8

Specifically for UUIDs in this document bits 64 and 65 of the UUID (bits 0 and 1 of octet 8) MUST be set to 1 and 0 as specified in row 2 of Table 1. Accordingly, all bit and field layouts avoid the use of these bits.

VERSION_7 = 7_u8

Constructors

Instance Method Summary

Constructor Detail

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

[View source]

Instance Method Detail

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 rand64 : UInt64 #

[View source]
def random : Random #

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

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

https://datatracker.ietf.org/doc/draft-ietf-uuidrev-rfc4122bis/07/ 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | unix_ts_ms | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | unix_ts_ms | ver | rand_a | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |var| rand_b | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | rand_b | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


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

[View source]