I’d like to generate 40-bit values, which are unique and non [so easily] guessable.
How can I do it? Any suggestions?
-edit-
I’m interested in an algorithm, C# or Java would be the cherry in the top of the cake!
-edit2-
I’m able to store previous values but I wouldn’t like to have to check the whole list everytime I generate a new number
What platform are you on? On unix-ish systems, just read 40bits from /dev/random (blocks if insufficient entropy is available) or /dev/urandom (doesn’t block, but also produces lower-quality random numbers if entropy is limited).