Reputation: 2211
Can I rely on the assumption that each generated id is random, and there's no way to user can guess? So that I don't need to do more double check of ownership and what not, on my application.
Upvotes: 0
Views: 100
Reputation: 4733
Generally you will only get random uuids if you configure your instance to use the random
algorithm. When looking at the source you can see that it then uses Erlang's crypto:rand_bytes/1. I'm not sure how predictable its results are, but you should note that there would also be crypto:strong_rand_bytes/1 - not sure why it hasn't been used.
I think the decision mostly depends on other circumstances.
/_log
API)?Upvotes: 1
Reputation: 5585
I wouldn't rely on that, no. A malicious user could make a lot of random guesses and could eventually hit something. Best to let identifiers identify things and security restrictions secure them.
Upvotes: 0