https://github.com/rwxrob/uniq-go
No Hassle Unique Identifiers
https://github.com/rwxrob/uniq-go
base32 base64 hexidecimal unique-identifiers uuid uuid-generator
Last synced: about 1 year ago
JSON representation
No Hassle Unique Identifiers
- Host: GitHub
- URL: https://github.com/rwxrob/uniq-go
- Owner: rwxrob
- License: apache-2.0
- Created: 2019-12-31T20:35:54.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-03-23T04:36:04.000Z (about 4 years ago)
- Last Synced: 2024-10-26T00:02:17.070Z (over 1 year ago)
- Topics: base32, base64, hexidecimal, unique-identifiers, uuid, uuid-generator
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING
- License: LICENSE
Awesome Lists containing this project
README
# No Hassle Unique Identifiers in Go
[](https://godoc.org/github.com/rwxrob/uniq-go)
[](https://goreportcard.com/report/github.com/rwxrob/uniq-go)
[](https://gocover.io/github.com/rwxrob/uniq-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:
* `uuid`
* `uid32`
* `isosec`
* `epoch [SECONDS]`
* `randhex [COUNT]`