Documentation ¶
Overview ¶
The uuid package can be used to generate and parse universally unique identifiers, a standardized format in the form of a 128 bit number.
Index ¶
Constants ¶
const ( VariantNCSCompat = 0 VariantIETF = 2 VariantMicrosoft = 6 VariantFuture = 7 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UUID ¶
type UUID [16]byte
func FromBytes ¶
FromBytes converts a raw byte slice to an UUID. It will panic if the slice isn't exactly 16 bytes long.
func ParseUUID ¶
ParseUUID parses a 32 digit hexadecimal number (that might contain hypens) represanting an UUID.
func RandomUUID ¶
func RandomUUID() UUID
RandomUUID generates a totally random UUID (version 4) as described in RFC 4122.
func TimeUUID ¶
func TimeUUID() UUID
TimeUUID generates a new time based UUID (version 1) as described in RFC 4122. This UUID contains the MAC address of the node that generated the UUID, a timestamp and a sequence number.
func (UUID) Bytes ¶
Bytes returns the raw byte slice for this UUID. A UUID is always 128 bits (16 bytes) long.
func (UUID) Node ¶
Node extracts the MAC address of the node who generated this UUID. It will return nil if the UUID is not a time based UUID (version 1).
func (UUID) String ¶
String returns the UUID in it's canonical form, a 32 digit hexadecimal number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
func (UUID) Timestamp ¶
Timestamp extracts the timestamp information from a time based UUID (version 1).