Fast cryptographically safe GUID generator for Go
10 months ago
- #Cryptography
- #Guid
- #Go
- Fast cryptographically safe Guid generator for Go by Stan Drapkin.
- Supports multiple functions: guid.New(), guid.NewString(), guid.Parse(s), guid.ParseBytes(b), guid.FromBytes(b), and guid.Nil.
- Performance benchmarks show guid.New() at 6~10 ns, guid.NewString() at 40~60 ns, and String() on existing guid at ~40 ns.
- Multi-goroutine calls do not increase per-call latency.
- Includes JSON marshalling and unmarshalling support for both value and pointer types.
- Install via 'go get -u github.com/sdrapkin/guid' and import in projects as 'github.com/sdrapkin/guid'.
- Comes with full documentation available at https://pkg.go.dev/github.com/sdrapkin/guid.