A pure Go package for creating and parsing UUIDs
open sourceMITfree
gofrs/uuid is a pure Go package for creating and parsing Universally Unique Identifiers as RFC 9562 defines them. It generates versions 1 (timestamp and MAC address), 3 and 5 (MD5 and SHA-1 hashes of a name), 4 (random), 6 and 7 (k-sortable, timestamp based) and 8 (custom), and parses UUIDs from strings in several formats. The Go Commune (gofrs) maintains it: it began as a fork of satori/go.uuid, taken over when that package seemed unmaintained and had critical flaws.
Problems it solves
- generate random or time-ordered UUIDs in a Go program
- parse and validate UUID strings in Go
- a maintained replacement for satori/go.uuid
Features
- UUID versions 1, 3, 4, 5, 6, 7 and 8
- Parses UUIDs from strings in different formats
- Pure Go, with no cgo
- k-sortable, timestamp-based version 6 and 7 UUIDs
Alternatives
The same job
These do what gofrs/uuid does.
- xid Short, sortable, globally unique IDs for Go with no configuration
- go-uuid (HashiCorp) UUID-format random strings for Go
