gouuid

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

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

Go to latest
Published: Jun 30, 2012 License: MIT Imports: 5 Imported by: 3

README

gouuid package implements [UUID](https://en.wikipedia.org/wiki/UUID#Version_4_.28random.29) (version 4, random) type and methods for the manipulation of it.

Documentation

Overview

gouuid package implements UUID (version 4, random) type and methods for the manipulation of it. It implements the encoding/json.Marshaler and encoding/json.Unmarshaler interface to allow easy handling with JSON.

Index

Constants

View Source
const (
	UUIDLen = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UUID

type UUID [UUIDLen]byte

func New

func New() (u UUID)

New generates and returns new UUID v4 (generated randomly).

func ParseString

func ParseString(s string) (UUID, error)

ParseString converts a string (hex uuid, can include dashes) to UUID.

func (UUID) Equal

func (u UUID) Equal(a UUID) bool

func (*UUID) MarshalJSON

func (u *UUID) MarshalJSON() ([]byte, error)

func (UUID) ShortString

func (u UUID) ShortString() string

ShortString returns short string representation (without dashes) of UUID. Example: b7c016dc2ba4a68db368a97da9f43cee

func (UUID) String

func (u UUID) String() string

func (*UUID) UnmarshalJSON

func (u *UUID) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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