Documentation ¶
Overview ¶
Package uidc provides cryptographic-grade functions to generate simple time-and-random-based unique identifiers.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewID128 ¶
func NewID128() string
NewID128 generates and return a new base-36-string-formatted 128 bit unique ID based on time (high 64 bit) and a random number (low 64 bit).
Example ¶
package main import ( "fmt" "github.com/Vonage/gosrvlib/pkg/uidc" ) func main() { v := uidc.NewID128() fmt.Println(v) }
Output:
func NewID64 ¶
func NewID64() string
NewID64 generates and return a new base-36-string-formatted 64 bit unique ID based on time (high 32 bit) and a random number (low 32 bit). NOTE: the zero time is set to the 1st of january of 10 year ago.
Example ¶
package main import ( "fmt" "github.com/Vonage/gosrvlib/pkg/uidc" ) func main() { v := uidc.NewID64() fmt.Println(v) }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.