Monday, April 7, 2014

Trust me, it's random!

Remember this soon-to-be-classic picture from xkcd?


There's a story for this, too. Not so obvious of course, but still rocks. Enjoy the new findings of Project Legacy Code:

$a = random8digit();
$b = random8digit();
$c = random8digit();
$d = random8digit();

for($i=0;$i<25;++$i){
$randomhash[$i] = $a.$b.$c.$d;
}

Trust me, they are chosen by a strong random value generator algorythm. This code is part of a free ecommerce script which -turns out- also has integrated parts of PayPal API. I would accept a bank transfer of random 8 digits :)

No comments:

Post a Comment