Re:Obfuscate Your Company
by eli on Friday May 29, 2009 @11:50PM
(#633233)
md5(rand())) doesn't really make much sense. It's slightly less random than just using rand().
[ Parent
| on HN ]
But it has a constant length and hides randomness from the observer.
"Hide randomness" ?
From hashes you'll recognize the fingerprint of the hash function but not the underlying data. Here is an example of random UIDs, generating a few user's in a row and it's obvious that it's random:
random.sample(xrange(10000), 10)
[88, 3833, 6353, 8113, 8983, 4280, 7878, 3050, 9409, 404]
So?
And if you generated random IDs with the same number of bits as a hash function they would be indistinguishable.
The code in the article comes from the example of this page http://www.php.net/manual/en/function.uniqid.php which has an interesting comments section on unique ids.