Sovereign 8s.is mirror of standardgalactic/uniq-go
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-03-23 00:35:40 -04:00
cmd Add SmartPrintln() for better line returns 2021-03-13 07:40:34 -05:00
CONTRIBUTING Add MPLv2 license, DCO, and contributors agreement 2021-03-09 21:27:31 -05:00
DCO Add MPLv2 license, DCO, and contributors agreement 2021-03-09 21:27:31 -05:00
example_test.go Fix isosec to use GMT time 2022-03-23 00:35:40 -04:00
go.mod Add SmartPrintln() for better line returns 2021-03-13 07:40:34 -05:00
go.sum Cleanup go.sum 2021-03-16 08:51:47 -04:00
LICENSE Change to Apache license 2021-03-12 12:57:26 -05:00
README.md Add MPLv2 license, DCO, and contributors agreement 2021-03-09 21:27:31 -05:00
uniq.go Fix isosec to use GMT time 2022-03-23 00:35:40 -04:00
uniq_test.go Fix isosec to use GMT time 2022-03-23 00:35:40 -04:00

No Hassle Unique Identifiers in Go

GoDoc Go Report
Card Coverage

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]