Skip to content

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

Merged
tsenart merged 6 commits into
masterfrom
ts/default-entropy
Jun 22, 2022
Merged

tsenart merged 6 commits into
masterfrom
ts/default-entropy

Conversation

@tsenart

@tsenart tsenart commented Jun 11, 2022

Copy link
Copy Markdown
Contributor

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.

tsenart added 3 commits June 11, 2022 16:48
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.
@tsenart
tsenart requested a review from peterbourgon June 11, 2022 16:44

@peterbourgon peterbourgon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Round 1.

Comment thread ulid.go Resolved
Comment thread ulid_test.go Resolved
Comment thread ulid_test.go Resolved
Comment thread ulid.go Resolved
Comment thread ulid.go Resolved
Comment thread ulid.go Resolved
Comment thread README.md 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
Copy Markdown

@peterbourgon Could you tag this for a new release?

@peterbourgon

Copy link
Copy Markdown
Member

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

@178inaba

Copy link
Copy Markdown

@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/[email protected]
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
Copy Markdown
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.

4 participants