Versions in this module Expand all Collapse all v2 v2.0.2 May 3, 2026 Changes in this version + var DefaultFormat Format = FormatCrockford + var DefaultGenerator = NewGenerator(1) + var Epoch int64 = 1765947799213000 + var NodeBits uint8 = 6 + var SeqBits uint8 = 6 + func Node(id int64) int64 + func Seq(id int64) int64 + func SetNodeID(node int64) + func SetObfuscator(key int64) + func Timestamp(id int64) time.Time + type Format string + const FormatBase58 + const FormatBase64 + const FormatCrockford + const FormatDecimal + const FormatHash + type Generator struct + func NewGenerator(node int64) *Generator + func (g *Generator) Generate() ID + type ID int64 + var Nil ID = 0 + var Omni ID = math.MaxInt64 + func FromBytes(b []byte) (ID, error) + func FromBytesOrNil(b []byte) ID + func FromInt64(n int64) ID + func FromString(s string) (ID, error) + func FromStringOrNil(s string) ID + func Must(id ID, err error) ID + func New() ID + func Parse(s string) (ID, error) + func ParseBase58(s string) (ID, error) + func ParseBase64(s string) (ID, error) + func ParseCrockford(s string) (ID, error) + func ParseDecimal(s string) (ID, error) + func ParseHash(s string) (ID, error) + func (id *ID) GobDecode(data []byte) error + func (id *ID) Parse(s string) error + func (id *ID) Scan(src interface{}) error + func (id *ID) UnmarshalBinary(data []byte) error + func (id *ID) UnmarshalJSON(b []byte) error + func (id *ID) UnmarshalText(b []byte) error + func (id ID) Bytes() []byte + func (id ID) Format(f ...Format) string + func (id ID) GobEncode() ([]byte, error) + func (id ID) Hash() [8]byte + func (id ID) Int64() int64 + func (id ID) IsNil() bool + func (id ID) MarshalBinary() ([]byte, error) + func (id ID) MarshalJSON() ([]byte, error) + func (id ID) MarshalText() ([]byte, error) + func (id ID) Node() int64 + func (id ID) Seq() int64 + func (id ID) String() string + func (id ID) Timestamp() time.Time + func (id ID) Value() (driver.Value, error) + type NullID struct + ID ID + Valid bool + func (n *NullID) Scan(src interface{}) error + func (n *NullID) UnmarshalJSON(b []byte) error + func (n *NullID) UnmarshalText(b []byte) error + func (n NullID) MarshalJSON() ([]byte, error) + func (n NullID) MarshalText() ([]byte, error) + func (n NullID) Value() (driver.Value, error) + type Obfuscator struct + var DefaultObfuscator *Obfuscator + func NewObfuscator(key int64) *Obfuscator + func (o *Obfuscator) Deobfuscate(id ID) ID + func (o *Obfuscator) Obfuscate(id ID) ID