go-guid

MongoDB style globally unique identifiers in Go

MIT License

Stars
16

GUID

Simple, thread-safe MongoDB style GUID generator.

Examples

func main {
	// Create a new 12-byte globally-unique identifier
	id := guid.New96()
	fmt.Println(hex.EncodeToString(id.Bytes()))
}
func main {
	// Create a new 16-byte globally-unique identifier
	id := guid.New128()
	fmt.Println(hex.EncodeToString(id.Bytes()))
}