Generating unique random numbers

Robert van Herk rherk at cs.uu.nl
Tue Jun 14 10:36:52 EDT 2005


Hello all,

Is it possible to generate random numbers that are "unique"  in O(1) in 
Haskell?

I mean something like the GUID-thingy Windows uses.

Of course, I could create unique numbers by incrementing a global value, 
but for security reasons I need random numbers. Also, I could use a list 
of numbers already in use, but this would mean that I'd not be able to 
generate a new number in O(1).

Any ideas?

Regards,
Robert


More information about the Glasgow-haskell-users mailing list