Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
norman70688419315dDo you know method with dice?
dudeking418115dSimplest method used by many sudo random algos is by taking a seed, usually based on the clock tick number. You multiply the number by 2, take middle 4 bits, duplicate them, and there u have it, a random number.
ruhe122914di = 0
i += 1
return 16325542**(i + seed) % 93837322727
sbiewald157814dFor generation unpredictable numbers by hardware, noise (audio, electrical) can be used.
In cryptography, symmetric encryption and/or hashing algorithms are used, as they are pretty much unpredictable.
For note details see, e.g. NIST's recommendation: https://nvlpubs.nist.gov/nistpubs/...
Your Job Suck?
Take a quick quiz from Triplebyte to skip the job search hassles and jump to final interviews at hot tech firms
Get a Better Job