Sovereign 8s.is mirror of standardgalactic/uniq-go
- Go 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| cmd | ||
| CONTRIBUTING | ||
| DCO | ||
| example_test.go | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| README.md | ||
| uniq.go | ||
| uniq_test.go | ||
No Hassle Unique Identifiers in Go
go get github.com/rwxrob/uniq-go
Package uniq is a utility package that provides common random unique identifiers in UUID, Base32, and n*2 random hexadecimal characters.
6c671957-2f39-4ce5-9f0e-e8d5ec53bfde (16 bytes, 36 chars, hex-)
H6M0STKP0MTSU0493GERQDCSJ5BMF3VO (20 bytes, 32 chars, base32)
5b ... (n bytes, n*2 chars, hex)
When a simple random identifier is all that is needed Base32() provides a better alternative to UUID(). It takes less space (32 characters), is safe for use with all file systems including case insensitive ones, and provides additional randomness increased from 2^128 (UUID) to 2^160 (Base32).
This package includes the following convenience commands as well for use when integrating with shell scripts:
uuiduid32isosecepoch [SECONDS]randhex [COUNT]