uuid

package
v0.0.0-...-f211112 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UUIDSize is the size in bytes of a UUID.
	UUIDSize = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UUID

type UUID []byte

UUID is a 16 byte UUID.

func NewUUID4

func NewUUID4() UUID

NewUUID4 returns a new UUID (Version 4) using 16 random bytes or panics.

The uniqueness depends on the strength of crypto/rand. Version 4 UUIDs have 122 random bits.

func (UUID) Short

func (u UUID) Short() string

Short formats the UUID using only the first four bytes for brevity.

func (UUID) String

func (u UUID) String() string

String formats as hex xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, or "" if u is invalid.

Jump to

Keyboard shortcuts

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