uuid

package
v0.0.0-...-4308112 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UUIDSnippet = block1 + "-" + block2 + "-" + block3 + "-" + block4 + "-" + block5
)

regex for validating that the UUID matches RFC 4122. This package generates version 4 UUIDs but accepts any UUID version. http://www.ietf.org/rfc/rfc4122.txt

Functions

func IsValidUUIDString

func IsValidUUIDString(s string) bool

IsValidUUIDString returns true, if the given string matches a valid UUID (version 4, variant 2).

Types

type UUID

type UUID [16]byte

UUID represent a universal identifier with 16 octets.

func MustNewUUID

func MustNewUUID() UUID

MustNewUUID returns a new uuid, if an error occurs it panics.

func NewUUID

func NewUUID() (UUID, error)

NewUUID generates a new version 4 UUID relying only on random numbers.

func UUIDFromString

func UUIDFromString(s string) (UUID, error)

func (UUID) Copy

func (uuid UUID) Copy() UUID

Copy returns a copy of the UUID.

func (UUID) Raw

func (uuid UUID) Raw() [16]byte

Raw returns a copy of the UUID bytes.

func (UUID) String

func (uuid UUID) String() string

String returns a hexadecimal string representation with standardized separators.

Jump to

Keyboard shortcuts

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