uuid

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Example usage:

package main

import (
	"fmt"

)

func main() {
	UUID4 := uuid.UUID4()
	fmt.Println("UUID4 is", UUID4)

	UUID5 := uuid.UUID5(uuid.NamespaceDNS, "SomeName")
	fmt.Println("UUID5", UUID5)
}

Index

Constants

This section is empty.

Variables

View Source
var (
	NamespaceDNS  = UUID{107, 167, 184, 16, 157, 173, 17, 209, 128, 180, 0, 192, 79, 212, 48, 200}
	NamespaceURL  = UUID{107, 167, 184, 17, 157, 173, 17, 209, 128, 180, 0, 192, 79, 212, 48, 200}
	NamespaceOID  = UUID{107, 167, 184, 18, 157, 173, 17, 209, 128, 180, 0, 192, 79, 212, 48, 200}
	NamespaceX500 = UUID{107, 167, 184, 20, 157, 173, 17, 209, 128, 180, 0, 192, 79, 212, 48, 200}
)

The following standard UUIDs are for use with UUID3() or UUID5().

Functions

This section is empty.

Types

type UUID

type UUID [16]byte

UUID represents a UUID

func ParseUUIDFromString

func ParseUUIDFromString(str string) (uuid UUID, err error)

ParseUUIDFromString parses a RFC 4122 compliant string representation of a uuid into a UUID4

func UUID3

func UUID3(namespace UUID, name string) UUID

UUID3 generates a version 3 UUID

func UUID4

func UUID4() UUID

UUID4 generates a version 4 UUID

func UUID5

func UUID5(namespace UUID, name string) UUID

UUID5 generates a version 5 UUID

func (UUID) String

func (u UUID) String() string

String provides the uuid in a format compliant with RFC 4122

Jump to

Keyboard shortcuts

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