buuid

package
v0.0.0-...-8b1022e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2016 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

README

buuid Travis CI Status Coverage Status GoDoc

buuid provides a type 4 UUID that can be encoded into a 16 byte binary representation.

To install:

go get github.com/getlantern/buuid

For docs:

godoc github.com/getlantern/buuid

Documentation

Overview

Package buuid provides a type 4 uuid that can be encoded into a 16 byte binary representation as two 64 bit integers in little endian byte order.

Index

Constants

View Source
const (
	EncodedLength = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

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

ID is a type 4 UUID.

func FromString

func FromString(s string) (ID, error)

FromString constructs an ID from the string-encoded version of a uuid.UUID.

func Random

func Random() ID

Random creates a random ID (uses uuid.NewRandom() which uses crypto.Random() under the covers)

func Read

func Read(b []byte) (ID, error)

Read reads the ID from a 16-byte or larger buffer

func (ID) String

func (id ID) String() string

String() returns the string-encoded version like in uuid.UUID.

func (ID) ToBytes

func (id ID) ToBytes() []byte

ToBytes returns a 16-byte representation of this ID

func (ID) Write

func (id ID) Write(b []byte) error

Write writes the ID to a 16-byte or larger buffer

Jump to

Keyboard shortcuts

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