25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Fix randoms:uniform/1 return

Make sure randoms:uniform/1 returns values from the same interval
as deprecated random:uniform/1
This commit is contained in:
Evgeniy Khramtsov 2016-10-18 08:35:47 +03:00
parent 4c5460f0bd
commit d19552f464

View File

@ -44,7 +44,7 @@ uniform() ->
crypto:rand_uniform(0, ?THRESHOLD)/?THRESHOLD. crypto:rand_uniform(0, ?THRESHOLD)/?THRESHOLD.
uniform(N) -> uniform(N) ->
crypto:rand_uniform(0, N). crypto:rand_uniform(1, N+1).
-ifdef(STRONG_RAND_BYTES). -ifdef(STRONG_RAND_BYTES).
bytes(N) -> bytes(N) ->