# Why are \`seed!\` and \`default\_rng\` not public?

**URL:** <https://discourse.julialang.org/t/why-are-seed-and-default-rng-not-public/117125>\
**Category:** General Usage\
**Tags:** compatibility, random\
**Created:** [July 17, 2024, 6:22am UTC](https://discourse.julialang.org/t/why-are-seed-and-default-rng-not-public/117125 "2024-07-17T06:22:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Post date:** [July 17, 2024, 6:22am UTC](https://discourse.julialang.org/t/why-are-seed-and-default-rng-not-public/117125/1 "2024-07-17T06:22:22Z")

</div>

```julia-repl
julia> VERSION
v"1.11.0-rc1"

julia> using Random

julia> Base.ispublic(Random, :seed!), Base.ispublic(Random, :default_rng)
(false, false)

```

Does this mean that one should avoid using these functions if the code should be compatible with future Julia versions?

If so, then what is a sensible alternative to something like:

```julia
using Random

myfunction(rng::AbstractRNG, n::Integer)
    rand(rng, 1:55, n, 2 * n)
end

myfunction(n::Integer)
    myfunction(Random.default_rng(), n)
end

```

---

<div class="post-metadata">

**Author:** ![DanielVandH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielvandh/32/31134_2.png) [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Post date:** [July 17, 2024, 6:51am UTC](https://discourse.julialang.org/t/why-are-seed-and-default-rng-not-public/117125/2 "2024-07-17T06:51:29Z")

</div>

They just haven’t been marked as public yet. This is being tracked over [Correctly mark all symbols as `public` or not · Issue #51335 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/51335) apparently
