struct CSUUID

Defined in:

csuuid.cr

Constant Summary

VERSION = "0.4.0"

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(seconds : Int64, nanoseconds : Int32, identifier : Slice(UInt8) | String | Nil = nil) #

[View source]
def self.new(uuid : String) #

[View source]
def self.new(uuid : UUID | CSUUID) #

[View source]
def self.new(timestamp : Time, identifier : Slice(UInt8) | String | Nil = nil) #

[View source]
def self.new(identifier : Slice(UInt8) | String | Nil = nil) #

[View source]

Class Method Detail

def self.generate(count) #

[View source]
def self.prng : Random::ISAAC | Random::PCG32 #

[View source]
def self.prng=(prng : Random::ISAAC | Random::PCG32) #

[View source]
def self.unique #

[View source]

Instance Method Detail

def <(other : CSUUID) : Bool #

Returns true if self is less than other.


[View source]
def <=(other : CSUUID) : Bool #

Returns true if self is less than or equal to other.


[View source]
def <=>(val) #

[View source]
def >(other : CSUUID) : Bool #

Returns true if self is greater than other.


[View source]
def >=(other : CSUUID) : Bool #

Returns true if self is greater than or equal to other.


[View source]
def bytes : Slice(UInt8) #

A getter to allow access to the raw byte buffer for the CSUUID.


[View source]
def 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.


[View source]
def timestamp : Time #

Return a Time object representing the timestamp encoded into the UUID as local time.


[View source]
def to_s(io : IO) : Nil #

Return the String representation of the UUID.


[View source]
def utc : Time #

Return a Time object representing the timestamp encoded into the UUID as UTC time.


[View source]