struct Xid
- Xid
- Struct
- Value
- Object
Included Modules
- Indexable(UInt8)
Defined in:
xid.crConstructors
-
.from_bytes(raw : B12 | Bytes) : Xid
generate a
Xidfrom bytes -
.from_s(base32 : String) : Xid
generate a
Xidfrom base32 string -
.generate : Xid
generate a
Xid - .new(time : B4, machine_id : B3, process_id : B2, count : B3)
Instance Method Summary
- #==(other : self)
-
#as_bytes : Bytes
Xidread only bytes view - #clone
- #copy_with(time _time = @time, machine_id _machine_id = @machine_id, process_id _process_id = @process_id, count _count = @count)
-
#count : UInt32
resolve count from
Xid -
#debug
print
Xiddebug info -
#machine_id : UInt32
resolve machine id from
Xid -
#process_id : UInt16
resolve process id from
Xid -
#time : Time
resolve time from
Xid -
#to_s : String
Xidto base32 string
Constructor Detail
generate a Xid from bytes
Example:
bytes = UInt8.static_array(0x4d, 0x88, 0xe1, 0x5b, 0x60, 0xf4, 0x86, 0xe4, 0x28, 0x41, 0x2d, 0xc9)
xid = Xid.from_bytes bytes
xid.debug
Instance Method Detail
def as_bytes : Bytes
#
def copy_with(time _time = @time, machine_id _machine_id = @machine_id, process_id _process_id = @process_id, count _count = @count)
#
def count : UInt32
#
def machine_id : UInt32
#
def process_id : UInt16
#