Tags: oklog/ulid
Tags
Add `ulid.Zero` and `.IsZero()` method (#112) * Add `uuid.Nil` and `.IsZero()` method 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 allocating a new empty ULID each time. Some packages avoid this by creating their own global (or private) nil ULIDs on initialization. This should be built in and simple for better perf & a cleaner API. * Update ulid.go * Update ulid.go * Update ulid.go * Update ulid_test.go * Update ulid_test.go --------- Co-authored-by: Peter Bourgon <[email protected]>
ulid: add DefaultEntropy() and Make() (#81) Users of this library have opened many issues regarding the difficulty of choosing an entropy source that is safe for concurrent use. This commit introduces a thread safe per process monotonically increase `DefaultEntropy()` function as well as an easy to use `Make()` function, aimed at users that want safe defaults chosen for them. Co-authored-by: Peter Bourgon <[email protected]>
ulid: add DefaultEntropy() and Make() (#81) Users of this library have opened many issues regarding the difficulty of choosing an entropy source that is safe for concurrent use. This commit introduces a thread safe per process monotonically increase `DefaultEntropy()` function as well as an easy to use `Make()` function, aimed at users that want safe defaults chosen for them. Co-authored-by: Peter Bourgon <[email protected]>
TestMonotonicSafe fails sometimes (#44) * TestMonotonicSafe fails sometimes * TestMonotonicSafe: vary seed and inc * Check for MonotonicReader interface instead of *monotonic * rm seed/inc variation in test, it's not relevant * TestMonotonicSafe should use multiple goroutines * t.Fatalf must be called in the same goroutine as the test
PreviousNext