Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^7: Generate a unique ID

by Anonymous Monk
on Nov 17, 2010 at 15:38 UTC ( #872007=note: print w/ replies, xml ) Need Help??

in reply to Re^6: Generate a unique ID
in thread Generate a unique ID

a 1 in 30 chance
That's just because your PRNG is only 15 bits:

$ perl -e 'printf "%.3f%", 2**15/1e4' 3.277%
With a decent PRNG, you'd have a much lower chance of collisions.
Comment on Re^7: Generate a unique ID
Download Code
Replies are listed 'Best First'.
Re^8: Generate a unique ID
by BrowserUk (Pope) on Nov 17, 2010 at 15:42 UTC

    I know :) I did mention that in the post above.

    I also mentioned earlier in the thread, that its use inside a function called truly_random() inside Data::UUID (amongst other things) makes that module suspect.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://872007]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2016-05-01 03:30 GMT
Find Nodes?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW

    Results (441 votes). Check out past polls.