uuid

package
v0.0.0-...-b7732f5 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NamespaceDNS, _  = Decode([]byte("6ba7b810-9dad-11d1-80b4-00c04fd430c8"))
	NamespaceURL, _  = Decode([]byte("6ba7b811-9dad-11d1-80b4-00c04fd430c8"))
	NamespaceOID, _  = Decode([]byte("6ba7b812-9dad-11d1-80b4-00c04fd430c8"))
	NamespaceX500, _ = Decode([]byte("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))
)

Functions

func Encode

func Encode(uuid UUID) []byte

Encode encodes UUID to "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format.

func HexEncode

func HexEncode(uuid UUID) []byte

func New

func New(ns [16]byte, name []byte) (uuid [16]byte)

Types

type UUID

type UUID [16]byte

func Decode

func Decode(data []byte) (uuid UUID, err error)

Decode decodes data with "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format into UUID.

func NewV1

func NewV1() UUID

NewV1 returns a STANDARD version 1 UUID.

func NewV1x

func NewV1x() UUID

NewV1x returns a NONSTANDARD UUID(lower probability of conflict).

func NewV5

func NewV5(ns UUID, name []byte) UUID

NewV5 returns a STANDARD version 5 UUID.

func (*UUID) Decode

func (uuid *UUID) Decode(data []byte) (err error)

Decode decodes data with "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format into UUID.

func (UUID) Encode

func (uuid UUID) Encode() []byte

Encode encodes UUID to "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format.

func (UUID) HexEncode

func (uuid UUID) HexEncode() []byte

func (UUID) String

func (uuid UUID) String() string

String returns "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format.

func (UUID) Variant

func (uuid UUID) Variant() Variant

func (UUID) Version

func (uuid UUID) Version() byte

type Variant

type Variant byte
const (
	VariantNCS Variant = iota
	VariantRFC4122
	VariantMicrosoft
	VariantFuture
)

func (Variant) String

func (v Variant) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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