ulid
ulid copied to clipboard
Universally Unique Lexicographically Sortable Identifier (ULID) in Go
Hi! I'm writing a new Ruby library for handling ULID in these days. Now I’m testing other implementations examples in https://github.com/kachick/ruby-ulid/issues/53. And I have found weird examples in original repository...
In this pull request, we have improved the performance of Parse. Instead of directly converting ULID to a [16]byte, it is converted through multiple uint64 variables. This change allows us...
I optimized the `MarshalTextTo` process by using uint64. Instead of directly converting ULID to a string, it is converted through a pair of uint64 variables. This change allows us to...
This simplifies comparisons with empty ULIDs. Right now, most people are doing something like the following to check if a ULID is non-zero: ```go id.Compare(ulid.ULID{}) == 0 ``` This requires...
Unix timestamps are always from UTC epoch, and calculation from given `time.Time` is independent of its location.
defaultEntropy() uses math/rand in order to be fast by default: ``` rng := rand.New(rand.NewSource(time.Now().UnixNano())) ``` ``` BenchmarkNew/WithCryptoEntropy-8 2000000 771 ns/op 20.73 MB/s 16 B/op 1 allocs/op BenchmarkNew/WithEntropy-8 20000000 65.8 ns/op...
Fix #69 The rust ulid crate has no #69 ‘s issue below, that is why our golang's library should same condition for command to use ulid.ParseStrict by default. crates: https://docs.rs/ulid/latest/ulid/...
If it is after merging https://github.com/oklog/ulid/pull/116, there is no performance difference between `Parse` and `ParseStrict`. ``` goos: darwin goarch: arm64 pkg: github.com/oklog/ulid/v2 │ .old.txt │ .new.txt │ │ sec/op │...
I'm sorry for the noise, as this is really a request for the creation of a similar but related library, I'm not exactly sure of a better way to do...