Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
OpenSSL::Random.write_random_file
(::String filename) -> true
write_random_file(filename) → true
ext/openssl/ossl_rand.c
View on GitHub ↗
static VALUE
ossl_rand_write_file(VALUE self, VALUE filename)
{
if (RAND_write_file(StringValueCStr(filename)) == -1) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
}
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.