Skip to content

change uuid to use Random.RandomDevice() instead of Random.default_rng() #35872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 27, 2020
4 changes: 2 additions & 2 deletions stdlib/UUIDs/src/UUIDs.jl
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ julia> uuid1(rng)
UUID("cfc395e8-590f-11e8-1f13-43a2532b2fa8")
```
"""
function uuid1(rng::AbstractRNG=Random.default_rng())
function uuid1(rng::AbstractRNG=Random.RandomDevice())
u = rand(rng, UInt128)

# mask off clock sequence and node
@@ -87,7 +87,7 @@ julia> uuid4(rng)
UUID("196f2941-2d58-45ba-9f13-43a2532b2fa8")
```
"""
function uuid4(rng::AbstractRNG=Random.default_rng())
function uuid4(rng::AbstractRNG=Random.RandomDevice())
u = rand(rng, UInt128)
u &= 0xffffffffffff0fff3fffffffffffffff
u |= 0x00000000000040008000000000000000