uuid

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NamespaceURL = UUID{0x6b, 0xa7, 0xb8, 0x11, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}

NamespaceURL is the UUID namespace for URLs (RFC 4122)

Functions

This section is empty.

Types

type UUID

type UUID [16]byte

func New

func New() UUID

New creates a UUID with random value.

func NewV5

func NewV5(namespace UUID, name string) UUID

NewV5 generates a UUID v5 (Name-Based UUID using SHA-1) from a namespace and name.

func ParseBytes

func ParseBytes(b []byte) (UUID, error)

ParseBytes converts a UUID in byte form to object.

func ParseString

func ParseString(str string) (UUID, error)

ParseString converts a UUID in string form to object.

func StringToUUID

func StringToUUID(str string) UUID

StringToUUID converts string to UUID. If str is not a valid UUID, it generates a Name-Based UUID v5.

func (*UUID) Bytes

func (u *UUID) Bytes() []byte

Bytes returns the bytes representation of this UUID.

func (*UUID) Equals

func (u *UUID) Equals(another *UUID) bool

Equals returns true if this UUID equals another UUID by value.

func (UUID) IsSet

func (u UUID) IsSet() bool

func (UUID) String

func (u UUID) String() string

String returns the string representation of this UUID.

func (UUID) ToSlice

func (u UUID) ToSlice() []byte

func (*UUID) UID

func (u *UUID) UID() *UUID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL