uuid: github.com/snluu/uuid Index | Files

package uuid

import "github.com/snluu/uuid"

uuid is a lightweight UUID implementation

Index

Package Files

doc.go uuid.go

type UUID Uses

type UUID [16]byte

UUID type.

func FromStr Uses

func FromStr(s string) (id UUID, err error)

FromStr returns a UUID based on a string. The string could be in the following format:

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

If the string is not in one of these formats, it'll return an error.

func MustFromStr Uses

func MustFromStr(s string) UUID

MustFromStr behaves similarly to FromStr except that it'll panic instead of returning an error.

func Rand Uses

func Rand() UUID

Rand generates a new version 4 UUID.

func (UUID) Hex Uses

func (this UUID) Hex() string

Hex returns a hex string representation of the UUID in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format.

Package uuid imports 8 packages (graph) and is imported by 1 packages. Updated 2017-02-26. Refresh now. Tools for package owners.