BSD::arc4random(3pm) | User Contributed Perl Documentation | BSD::arc4random(3pm) |
BSD::arc4random - Perl interface to the arc4 random number generator
use BSD::arc4random qw(:all); $v = arc4random(); $v = arc4random_uniform($hz); if (!BSD::arc4random::have_kintf()) { $v = arc4random_addrandom("entropy to pass to the system"); } else { $v = arc4random_pushb("entropy to pass to the system"); $v = arc4random_pushk("entropy to pass to the kernel"); } $s = arc4random_bytes(16, "entropy to pass to libc"); arc4random_stir(); $s = arc4random_bytes(16); print $RANDOM;
This set of functions maps the arc4random(3) family of libc functions into Perl code. All functions listed below are ithreads-safe. The internal XS functions are not, but you are not supposed to call them, either.
On module load, perl's internal PRNG is re-seeded, as a bonus, using srand with an argument calculated from using arc4random_pushb on some entropy returned from rand's previous state.
This function is deprecated. Use arc4random_pushb instead.
Thorsten Glaser <tg@mirbsd.de>
The arc4random(3) manual page, available online at: <https://www.mirbsd.org/man/arc4random.3>
Perl's rand and srand functions via perlfunc and perlfaq4.
The randex.pl plugin for Irssi, implementing the MirOS RANDEX protocol (entropy exchange over IRC), with CVSweb at: <http://cvs.mirbsd.de/ports/net/irssi/files/randex.pl>
<https://www.mirbsd.org/a4rp5bsd.htm> when it's done being written.
Copyright (c) 2008, 2009, 2010, 2011 Thorsten "mirabilos" Glaser Copyright (c) 2009 Benny Siegert Credits to Sebastian "Vutral" Schwarz
This module is covered by the MirOS Licence: <http://mirbsd.de/MirOS-Licence>
The original C implementation of arc4random_uniform was contributed by Damien Miller from OpenBSD, with simplifications by Jinmei Tatuya.
2022-10-19 | perl v5.36.0 |