Use crypto:rand_seed().
It's cryptographically strong and set a better state for the pseudo-random number generator.main
parent
ab3ca1ec64
commit
e571a69820
|
@ -69,6 +69,7 @@ is_conflict(Req, user_exists) -> {true, Req, []};
|
|||
is_conflict(Req, State) -> {false, Req, State}.
|
||||
|
||||
create_user(Req, {Bucket, [{name, Name}, {username, User}, {password, Pass}]}) ->
|
||||
crypto:rand_seed(),
|
||||
Salt = rand:bytes(32),
|
||||
Hash = crypto:hash(sha256, <<Pass/binary, Salt/binary>>),
|
||||
|
||||
|
|
Loading…
Reference in New Issue