Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

OpenSSL::Random.write_random_file

(::String filename) -> true
write_random_file(filename) → true

Writes a number of random generated bytes (currently 1024) to filename which can be used to initialize the PRNG by calling ::load_random_file in a later session.

See also .status? .seed also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0