Random number generator (device): Difference between revisions

X86 Assembly - RDRAND
(X86 Assembly - RDRAND)
Line 791:
=={{header|UNIX Shell}}==
<lang UNIX Shell>od -An -N 4 -t u4 /dev/urandom</lang>
 
=={{header|X86 Assembly}}==
Processors supporting the new RDRAND feature can generate a random 32-bit integer in two instructions:
<lang x86>L: rdrand eax
jnc L</lang>
RDRAND reads the CPU's cryptographically-secure hardware random number generator. The loop is needed because RDRAND can occasionally fail to retrieve a value — it sets the carry flag to indicate whether it succeeded.
 
=={{header|XPL0}}==
Anonymous user