4 ms·
Impressive. Only one thing bugs me: "but I replace 'xor' with a mathematically equivalent 'modulus' operation." Unless you scan 256,512,768,etc. number of por
by babuskov 13y ago
Impressive.
Only one thing bugs me: "but I replace 'xor' with a mathematically equivalent 'modulus' operation."
Unless you scan 256,512,768,etc. number of ports there will be bias, and sequence only looks random. I suggest the author to take a look at this:
http://eternallyconfuzzled.com/arts/jsw_art_rand.aspx http://eternallyconfuzzled.com/arts/jsw_art_rand.aspx
- Scaevolus 13y agoThat article still gives a biased answer! Floating point numbers have limited precision, too. http://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful http://channel9.msdn.com/Events/GoingNative/2013/rand-Consid...
- robertgraham 13y agoI'm not using % on the result of rand(). I'm using the "Feistal network" construction that is at the heart of the data encryption standard, replacing binary operations like 'xor' with the "addition plus modulus" operation. My found function sucks, and I only do 3 rounds, so there's probably some issues there. But, if I were to fix those issues, then there should be no more detectable bias than in the original DES cipher.