uuid

package
v0.4.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package uuid defines functionality for creating UUIDs as defined in RFC 4122.

Currently only Version 5 (SHA1) and Version 3 (MD5) are supported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromInt

func FromInt(i *big.Int) (string, error)

FromInt creates a UUID from an integer.

DNS:  uuid.FromInt(0x6ba7b810_9dad_11d1_80b4_00c04fd430c8)

func MD5

func MD5(space string, data []byte) (string, error)

MD5 generates a version 3 UUID based on the supplied name space and data. Use SHA1 instead if you can.

func Parse

func Parse(s string) (string, error)

Parse decodes s into a UUID or returns an error. Both the standard UUID forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

func SHA1

func SHA1(space string, data []byte) (string, error)

SHA1 generates a version 5 UUID based on the supplied name space and data.

func ToInt

func ToInt(x string) *big.Int

ToInt represents a UUID string as a 128-bit value.

func ToString

func ToString(x string) string

String represents a 128-bit UUID value as a string.

func URN

func URN(x string) (string, error)

URN reports the canonical URN of a UUID.

func Valid

func Valid(s string) error

Valid can be used to define a valid Valid.

func Variant

func Variant(x string) (int, error)

Variant reports the UUID variant.

func Version

func Version(x string) (int, error)

Version reports the UUID version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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