Sunday, March 24, 2013

[xmaaaimj] Random numbers for shell scripts

#!perl -lw
# This is more random than bash's $RANDOM variable
open URANDOM, "/dev/urandom" or die; $bytes=2; die unless(read(URANDOM,$x,$bytes)==$bytes); print unpack("S",$x)&32767

No comments :