Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ulid: add DefaultEntropy() and Make() #81

Merged
merged 6 commits into from
Jun 22, 2022
Merged

ulid: add DefaultEntropy() and Make() #81

merged 6 commits into from
Jun 22, 2022

Conversation

tsenart
Copy link
Contributor

@tsenart tsenart commented Jun 11, 2022

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.

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.
Copy link
Member

@peterbourgon peterbourgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1.

ulid.go Outdated Show resolved Hide resolved
ulid_test.go Outdated Show resolved Hide resolved
ulid_test.go Outdated Show resolved Hide resolved
ulid.go Outdated Show resolved Hide resolved
ulid.go Show resolved Hide resolved
ulid.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@tsenart tsenart merged commit 09b4b3e into master Jun 22, 2022
@tsenart tsenart deleted the ts/default-entropy branch June 22, 2022 15:26
@ganigeorgiev
Copy link

@peterbourgon Could you tag this for a new release?

@peterbourgon
Copy link
Member

@ganigeorgiev Check out v2.1.0-alpha.1 and gimme some feedback :)

@178inaba
Copy link

@peterbourgon
I also confirmed! I was able to use Make.

package main

import (
	"fmt"

	"github.com/oklog/ulid/v2"
)

func main() {
	fmt.Printf("ulid.Make(): %s\n", ulid.Make())
}
$ go get github.com/oklog/ulid/v2@v2.1.0-alpha.1
go: upgraded github.com/oklog/ulid/v2 v2.0.2 => v2.1.0-alpha.1

$ go run main.go
ulid.Make(): 01G7MSBEWS6WMSTABGZQ8W5W3S

@peterbourgon
Copy link
Member

https://github.com/oklog/ulid/releases/tag/v2.1.0 is released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants