buuid

package module
v0.0.0-...-8f14456 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2016 License: Apache-2.0 Imports: 4 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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