uuid

package module
v0.0.0-...-0636378 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2015 License: LGPL-3.0 Imports: 4 Imported by: 0

README

Build Status

uuid

Golang binding for the C-library libuuid.

Documentation

Overview

Package uuid provides a simple binding to the C-library libuuid.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Uuid

type Uuid struct {
	// contains filtered or unexported fields
}

Uuid holds the binary representation of a universally unique identifier (UUID).

func (*Uuid) Clear

func (uu *Uuid) Clear()

Clear sets the value of the Uuid variable uu to the nil value.

func (Uuid) CompareTo

func (uu Uuid) CompareTo(uu2 Uuid) int

CompareTo compares the two supplied Uuid variables uu and uu2 to each other. Returns an integer less than, equal to, or greater than zero if uu is found, respectively, to be lexicographically less than, equal, or greater than uu2.

func (Uuid) Copy

func (uu Uuid) Copy() (result Uuid)

Copy returns a copy of the Uuid variable uu.

func (Uuid) CopyTo

func (uu Uuid) CopyTo(uu2 *Uuid)

CopyTo copies the uu into uu2.

func (*Uuid) Generate

func (uu *Uuid) Generate()

Generate creates a new universally unique identifier (UUID). The UUID will be generated based on high-quality randomness generator. (i.e.from /dev/urandom), if available. If it is not available, then it will use an alternative algorithm which uses the current time, the local ethernet MAC address (if available), and random data generated using a pseudo-random generator.

func (*Uuid) GenerateRandom

func (uu *Uuid) GenerateRandom() error

GenerateRandom forces the use of the all-random UUID format, even if a high-quality generator (i.e. /dev/urandom) is not available, in which case a pseudo-random generator will be substituted. Note that the use of a pseudo-random generator may compromise the uniqueness of UUIDs generated in this fasion.

func (*Uuid) GenerateTime

func (uu *Uuid) GenerateTime()

GenerateTime furces the use of the alternative algorithm which uses the current time and the local ethernet MAC address, it can leak information about when and where the UUID was generated.

func (*Uuid) GenerateTimeSafe

func (uu *Uuid) GenerateTimeSafe()

GenerateTimeSafe is similar to GenerateTime, except that it returns a value which denotes whether any of the synchronization mechanisms has been used.

func (Uuid) IsNil

func (uu Uuid) IsNil() bool

IsNil compares the value of the supplied Uuid variable uu to the Nil value.

func (Uuid) String

func (uu Uuid) String() string

String converts the suplied Uuid uu from the binary representation into a 32-byte string value of the form '1b4e28ba2fa111d2883f0016d3cca427'.

func (Uuid) ToGuid

func (uu Uuid) ToGuid() string

ToGuid converts the suplied Uuid uu from the binary representation into a 36-byte string value of the form '1b4e28ba-2fa1-11d2-883f-0016d3cca427'.

Jump to

Keyboard shortcuts

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