struct CSUUID
- CSUUID
- Struct
- Value
- Object
Defined in:
csuuid.crConstant Summary
-
VERSION =
"0.4.0"
Constructors
- .new(seconds : Int64, nanoseconds : Int32, identifier : Slice(UInt8) | String | Nil = nil)
- .new(uuid : String)
- .new(uuid : UUID | CSUUID)
- .new(timestamp : Time, identifier : Slice(UInt8) | String | Nil = nil)
- .new(identifier : Slice(UInt8) | String | Nil = nil)
Class Method Summary
- .generate(count)
- .prng : Random::ISAAC | Random::PCG32
- .prng=(prng : Random::ISAAC | Random::PCG32)
- .unique
Instance Method Summary
-
#<(other : CSUUID) : Bool
Returns
true
ifself
is less than other. -
#<=(other : CSUUID) : Bool
Returns
true
ifself
is less than or equal to other. - #<=>(val)
-
#>(other : CSUUID) : Bool
Returns
true
ifself
is greater than other. -
#>=(other : CSUUID) : Bool
Returns
true
ifself
is greater than or equal to other. -
#bytes : Slice(UInt8)
A getter to allow access to the raw byte buffer for the CSUUID.
-
#seconds_and_nanoseconds : Tuple(Int64, Int32)
This returns a tuple containing the seconds since the epoch as well as the nanoseconds in the current second for the UUID.
-
#timestamp : Time
Return a Time object representing the timestamp encoded into the UUID as local time.
-
#to_s(io : IO) : Nil
Return the String representation of the UUID.
-
#utc : Time
Return a Time object representing the timestamp encoded into the UUID as UTC time.
Constructor Detail
Class Method Detail
Instance Method Detail
Returns true
if self
is greater than or equal to other.
This returns a tuple containing the seconds since the epoch as well as the nanoseconds in the current second for the UUID.
Return a Time object representing the timestamp encoded into the UUID as local time.