Generated from Manticore v1.1.5 • 201 packages. View on pkg.go.dev

uuid_v4

import "github.com/TheManticoreProject/Manticore/crypto/uuid/uuid_v4"

Index

type UUIDv4

UUIDv4 is a random-based UUID (version 4). It contains 122 bits of randomness with version and variant bits set per RFC 4122.

type UUIDv4 struct {
    uuid.UUID
    // contains filtered or unexported fields
}

func (*UUIDv4) FromString

func (u *UUIDv4) FromString(uuidStr string) error

FromString parses a UUID string in the format “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”.

func (*UUIDv4) Generate

func (u *UUIDv4) Generate() error

Generate fills the UUID with random bytes and sets version=4 and RFC 4122 variant.

func (*UUIDv4) Marshal

func (u *UUIDv4) Marshal() ([]byte, error)

Marshal converts the UUIDv4 structure to a 16-byte array. Call Generate() first.

func (*UUIDv4) String

func (u *UUIDv4) String() string

String returns the canonical string form of the UUIDv4.

func (*UUIDv4) Unmarshal

func (u *UUIDv4) Unmarshal(marshalledData []byte) (int, error)

Unmarshal converts a 16-byte array into a UUIDv4 structure.