diff --git a/uuid.erl b/uuid.erl index 2986df0..8f75e9c 100644 --- a/uuid.erl +++ b/uuid.erl @@ -33,7 +33,10 @@ % Generates a random binary UUID. v4() -> - v4(crypto:rand_uniform(1, round(math:pow(2, 48))) - 1, crypto:rand_uniform(1, round(math:pow(2, 12))) - 1, crypto:rand_uniform(1, round(math:pow(2, 32))) - 1, crypto:rand_uniform(1, round(math:pow(2, 30))) - 1). + v4(crypto:rand_uniform(1, 1 bsl 48), + crypto:rand_uniform(1, 1 bsl 12), + crypto:rand_uniform(1, 1 bsl 32), + crypto:rand_uniform(1, 1 bsl 30)). v4(R1, R2, R3, R4) -> <>.