rs / xid

xid is a globally unique id generator thought for the web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cryptographically secure ?

psankar opened this issue · comments

Hi, Thanks for the package. I have been using this in a project of mine and it is very helpful. This is more a usage question than an Issue.

Are the ids generated by this package cryptographically secure ? There are quite a few sources that you use (machine id, process id, counter etc.) but the documentation does not say anything about if it is cryptographically secure (unpredictable) to use this package when there is a necessity. It will be good to mention the answer to this in the README. Thanks once again.

As it’s based on env, time and monotonic counter, it is NOT crypto secure. If you need non predictability, you’ll have to use another solution. The xid package does only guarantee global uniqueness.

Thanks. Do you think that it will be worth adding to the README.md, if so I would keep the issue open (and will send a PR tomorrow mentioning the same) ? Else it could be closed.

I created #24 Thanks.