nulid is a dependency-free Go implementation of NULID, a 128-bit
lexicographically sortable identifier. It is a nanosecond-resolution descendant
of ULID: while a ULID carries a 48-bit
millisecond timestamp, a NULID carries a 68-bit nanosecond timestamp.
That gives you much tighter ordering when you're generating IDs at high throughput,
but it still keeps the same 128-bit / 26-character footprint.
go get github.com/yzevm/nulidimport "github.com/yzevm/nulid"
func main() {
id := nulid.Make() // crypto/rand entropy, current time
fmt.Println((id.String())) // e.g. 01H1CD7M59WM8N000000000C1S
fmt.Println(id.Random()) // 60-bit random component
fmt.Println(id.Time()) // time.Time, full precision
}