Versions in this module Expand all Collapse all v0 v0.2.1 Jul 29, 2026 v0.2.0 Jul 29, 2026 Changes in this version + const IDSize + const SortableIDSize + const StrongIDSize + const TokenSize + const UUIDSize + var ErrCounterExhausted = errors.New("quuid: monotonic identifier counter exhausted") + var ErrInvalidEncoding = errors.New("quuid: invalid identifier encoding") + var ErrInvalidLength = errors.New("quuid: invalid identifier length") + var ErrInvalidPrefix = errors.New("quuid: invalid identifier prefix") + var ErrInvalidSource = errors.New("quuid: unsupported database source type") + var ErrNilValue = errors.New("quuid: nil cannot be assigned to a non-null identifier") + var ErrTimeOutOfRange = errors.New("quuid: time is outside the supported identifier range") + var ErrWeakSecret = errors.New("quuid: secret must contain at least 32 bytes") + var ErrZeroEntropy = errors.New("quuid: entropy source returned an all-zero value") + func ValidateRFC9562UUID(s string) error + func ValidateUUID(s string) error + func VerifyToken(presented string, expected TokenDigest) bool + type BinaryUUID UUID + func (id *BinaryUUID) Scan(src any) error + func (id *BinaryUUID) UnmarshalBinary(data []byte) error + func (id *BinaryUUID) UnmarshalJSON(data []byte) error + func (id *BinaryUUID) UnmarshalText(text []byte) error + func (id BinaryUUID) AppendBinary(dst []byte) ([]byte, error) + func (id BinaryUUID) AppendText(dst []byte) ([]byte, error) + func (id BinaryUUID) Bytes() []byte + func (id BinaryUUID) Compare(other BinaryUUID) int + func (id BinaryUUID) Equal(other BinaryUUID) bool + func (id BinaryUUID) IsZero() bool + func (id BinaryUUID) MarshalBinary() ([]byte, error) + func (id BinaryUUID) MarshalJSON() ([]byte, error) + func (id BinaryUUID) MarshalText() ([]byte, error) + func (id BinaryUUID) String() string + func (id BinaryUUID) UUID() UUID + func (id BinaryUUID) Value() (driver.Value, error) + func (id BinaryUUID) Variant() Variant + func (id BinaryUUID) Version() Version + type Generator struct + func NewGenerator() *Generator + func NewGeneratorWith(reader io.Reader, clock func() time.Time) (*Generator, error) + func (g *Generator) NewID() (ID, error) + func (g *Generator) NewMonotonicSortableID() (SortableID, error) + func (g *Generator) NewSortableID() (SortableID, error) + func (g *Generator) NewStrongID() (StrongID, error) + func (g *Generator) NewUUIDv4() (UUID, error) + func (g *Generator) NewUUIDv6() (UUID, error) + func (g *Generator) NewUUIDv7() (UUID, error) + func (g *Generator) NewUUIDv8() (UUID, error) + type ID [IDSize]byte + func DeriveID(namespace string, data []byte) ID + func DeriveIDKeyed(secret []byte, namespace string, data []byte) (ID, error) + func MustNewID() ID + func MustParseID(s string) ID + func NewID() (ID, error) + func NewIDFromReader(r io.Reader) (ID, error) + func ParseID(s string) (ID, error) + func (id *ID) Scan(src any) error + func (id *ID) UnmarshalBinary(data []byte) error + func (id *ID) UnmarshalJSON(data []byte) error + func (id *ID) UnmarshalText(text []byte) error + func (id ID) AppendBinary(dst []byte) ([]byte, error) + func (id ID) AppendText(dst []byte) ([]byte, error) + func (id ID) Bytes() []byte + func (id ID) Compare(other ID) int + func (id ID) Equal(other ID) bool + func (id ID) Hex() string + func (id ID) IsZero() bool + func (id ID) MarshalBinary() ([]byte, error) + func (id ID) MarshalJSON() ([]byte, error) + func (id ID) MarshalText() ([]byte, error) + func (id ID) String() string + func (id ID) Value() (driver.Value, error) + type NullBinaryUUID struct + UUID UUID + Valid bool + func NewNullBinaryUUID(id UUID) NullBinaryUUID + func ToNullBinaryUUID(id UUID) NullBinaryUUID + func (n *NullBinaryUUID) Scan(src any) error + func (n *NullBinaryUUID) UnmarshalJSON(data []byte) error + func (n NullBinaryUUID) MarshalJSON() ([]byte, error) + func (n NullBinaryUUID) Value() (driver.Value, error) + type NullID struct + ID ID + Valid bool + func (n *NullID) Scan(src any) error + func (n *NullID) UnmarshalJSON(data []byte) error + func (n NullID) MarshalJSON() ([]byte, error) + func (n NullID) Value() (driver.Value, error) + type NullUUID struct + UUID UUID + Valid bool + func NewNullUUID(id UUID) NullUUID + func ToNullUUID(id UUID) NullUUID + func (n *NullUUID) Scan(src any) error + func (n *NullUUID) UnmarshalJSON(data []byte) error + func (n NullUUID) MarshalJSON() ([]byte, error) + func (n NullUUID) Value() (driver.Value, error) + type SortableID [SortableIDSize]byte + func MustNewSortableID() SortableID + func MustParseSortableID(s string) SortableID + func NewSortableID() (SortableID, error) + func NewSortableIDAt(t time.Time, r io.Reader) (SortableID, error) + func ParseSortableID(s string) (SortableID, error) + func (id *SortableID) Scan(src any) error + func (id *SortableID) UnmarshalBinary(data []byte) error + func (id *SortableID) UnmarshalJSON(data []byte) error + func (id *SortableID) UnmarshalText(text []byte) error + func (id SortableID) AppendBinary(dst []byte) ([]byte, error) + func (id SortableID) AppendText(dst []byte) ([]byte, error) + func (id SortableID) Bytes() []byte + func (id SortableID) Compare(other SortableID) int + func (id SortableID) Entropy() ID + func (id SortableID) Equal(other SortableID) bool + func (id SortableID) Hex() string + func (id SortableID) IsZero() bool + func (id SortableID) MarshalBinary() ([]byte, error) + func (id SortableID) MarshalJSON() ([]byte, error) + func (id SortableID) MarshalText() ([]byte, error) + func (id SortableID) String() string + func (id SortableID) Timestamp() time.Time + func (id SortableID) Value() (driver.Value, error) + type StrongID [StrongIDSize]byte + func DeriveStrongID(namespace string, data []byte) StrongID + func DeriveStrongIDKeyed(secret []byte, namespace string, data []byte) (StrongID, error) + func MustNewStrongID() StrongID + func MustParseStrongID(s string) StrongID + func NewStrongID() (StrongID, error) + func NewStrongIDFromReader(r io.Reader) (StrongID, error) + func ParseStrongID(s string) (StrongID, error) + func (id *StrongID) Scan(src any) error + func (id *StrongID) UnmarshalBinary(data []byte) error + func (id *StrongID) UnmarshalJSON(data []byte) error + func (id *StrongID) UnmarshalText(text []byte) error + func (id StrongID) AppendBinary(dst []byte) ([]byte, error) + func (id StrongID) AppendText(dst []byte) ([]byte, error) + func (id StrongID) Bytes() []byte + func (id StrongID) Compare(other StrongID) int + func (id StrongID) Equal(other StrongID) bool + func (id StrongID) Hex() string + func (id StrongID) IsZero() bool + func (id StrongID) MarshalBinary() ([]byte, error) + func (id StrongID) MarshalJSON() ([]byte, error) + func (id StrongID) MarshalText() ([]byte, error) + func (id StrongID) String() string + func (id StrongID) Value() (driver.Value, error) + type Token [TokenSize]byte + func MustNewToken() Token + func NewToken() (Token, error) + func NewTokenFromReader(r io.Reader) (Token, error) + func ParseToken(s string) (Token, error) + func (token Token) Bytes() []byte + func (token Token) Digest() TokenDigest + func (token Token) Redacted() string + func (token Token) Secret() string + func (token Token) String() string + type TokenDigest [32]byte + func (digest TokenDigest) String() string + type UUID [UUIDSize]byte + var MaxUUID = UUID{ ... } + var NilUUID UUID + func DeriveUUIDv8(namespace string, data []byte) UUID + func DeriveUUIDv8Keyed(secret []byte, namespace string, data []byte) (UUID, error) + func MustNewUUIDv4() UUID + func MustNewUUIDv6() UUID + func MustNewUUIDv7() UUID + func MustNewUUIDv8() UUID + func MustParseUUID(s string) UUID + func NewUUIDv4() (UUID, error) + func NewUUIDv4FromReader(r io.Reader) (UUID, error) + func NewUUIDv6() (UUID, error) + func NewUUIDv6At(t time.Time, r io.Reader) (UUID, error) + func NewUUIDv7() (UUID, error) + func NewUUIDv7At(t time.Time, r io.Reader) (UUID, error) + func NewUUIDv7FromReader(r io.Reader) (UUID, error) + func NewUUIDv8() (UUID, error) + func NewUUIDv8FromReader(r io.Reader) (UUID, error) + func ParseUUID(s string) (UUID, error) + func ParseUUIDBytes(text []byte) (UUID, error) + func ParseUUIDLoose(s string) (UUID, error) + func (id *UUID) Scan(src any) error + func (id *UUID) UnmarshalBinary(data []byte) error + func (id *UUID) UnmarshalJSON(data []byte) error + func (id *UUID) UnmarshalText(text []byte) error + func (id UUID) AppendBinary(dst []byte) ([]byte, error) + func (id UUID) AppendText(dst []byte) ([]byte, error) + func (id UUID) Binary() BinaryUUID + func (id UUID) Bytes() []byte + func (id UUID) Compare(other UUID) int + func (id UUID) Equal(other UUID) bool + func (id UUID) IsZero() bool + func (id UUID) MarshalBinary() ([]byte, error) + func (id UUID) MarshalJSON() ([]byte, error) + func (id UUID) MarshalText() ([]byte, error) + func (id UUID) String() string + func (id UUID) Time() (time.Time, error) + func (id UUID) Value() (driver.Value, error) + func (id UUID) Variant() Variant + func (id UUID) Version() Version + type Variant byte + const VariantFuture + const VariantMicrosoft + const VariantNCS + const VariantRFC9562 + func (v Variant) String() string + type Version byte + const Version1 + const Version2 + const Version3 + const Version4 + const Version5 + const Version6 + const Version7 + const Version8 + const VersionUnknown + func (v Version) String() string