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

Cryptographically secure comparing to ULID #63

Open
drasko opened this issue Oct 31, 2020 · 0 comments
Open

Cryptographically secure comparing to ULID #63

drasko opened this issue Oct 31, 2020 · 0 comments

Comments

@drasko
Copy link

drasko commented Oct 31, 2020

There is a note in the README:

Xid is dependent on the system time, a monotonic counter and so is not cryptographically secure. If unpredictability of IDs is important, you should not use Xids. It is worth noting that most other UUID-like implementations are also not cryptographically secure. You should use libraries that rely on cryptographically secure sources (like /dev/urandom on unix, crypto/rand in golang), if you want a truly random ID generator.

Can XID be used with those random generators and how?

On the other hand, fr ULID that should be possible: https://github.com/ulid/javascript#pseudo-random-number-generators, and here is an example how: https://github.com/prometheus/prometheus/pull/6867/files

Is there a similar example for XID (if this is at all possible)?

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

No branches or pull requests

1 participant