uuid

package
v12.125.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package uuid contains methods for generating version 4 and 5 UUID's

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	NsDNS  = []byte{107, 167, 184, 16, 157, 173, 17, 209, 128, 180, 0, 192, 79, 212, 48, 200}
	NsURL  = []byte{107, 167, 184, 17, 157, 173, 17, 209, 128, 180, 0, 192, 79, 212, 48, 200}
	NsOID  = []byte{107, 167, 184, 18, 157, 173, 17, 209, 128, 180, 0, 192, 79, 212, 48, 200}
	NsX500 = []byte{107, 167, 184, 20, 157, 173, 17, 209, 128, 180, 0, 192, 79, 212, 48, 200}
)

Predefined namespace UUID's

Functions

This section is empty.

Types

type UUID added in v12.81.0

type UUID []byte

UUID contains UUID data

func UUID4 added in v12.81.0

func UUID4() UUID

UUID4 generates random generated UUID v4

Example
fmt.Printf("UUID v4: %s\n", UUID4().String())
Output:

func UUID5 added in v12.81.0

func UUID5(ns []byte, name string) UUID

UUID5 generates UUID v5 based on SHA-1 hash of namespace UUID and name

Example
fmt.Printf("UUID v5: %s\n", UUID5(NsURL, "http://www.domain.com").String())
Output:

func (UUID) String added in v12.81.0

func (u UUID) String() string

String returns string representation of UUID

Jump to

Keyboard shortcuts

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