Kyorai / riak_core

Distributed systems infrastructure used by Riak.
Apache License 2.0
101 stars 23 forks source link

prefer crypto:strong_rand_bytes/1 #15

Closed getong closed 7 years ago

getong commented 7 years ago

I just see the cowlib use the strong_rand_bytes/1 to replace the rand_bytes/1. So I add the code here, see Fix #39

Licenser commented 7 years ago

merged and reverted again strong bytes can throw exceptions.

Licenser commented 7 years ago

Mate I appreciate your contributions and enthusiasm but I must ask you to be a bit more diligent before opening a PR. It's neither fun for you to have your changes reverted nor is it fun for me to nit pick over every change and investigate every function.

If you read the documentation of strong_random_bytes it will throw errors of the random source is out of data this can be quite fatal and doesn't sound like a very great idea.

getong commented 7 years ago

Sorry. I had read the doc before I made a PR, and I know to add the catch before the function, but I think it is worth doing it. A little change must be made.