JT Moree wrote: > > Is this uique enough? what is the chance of getting the same random > number again? should it be a combination of the PID + time + rand? >
my @sname = split(/\./, $self->qp->config("me")); = $sname[0].$$.'r'.int( (( time ^ $$ ) * rand($$)) / rand(time/$$)); = sprintf("%08X", rand(2**32 - 1)); $self->qp->config("me") =~ m/\.(\d{1,3}$/; #not tested $self->{_id} = $1; = sprintf("%.4f%d", time(), $self->{_id}); = sprintf("%.4f", time()) .".". $self->qp->config("me") . \ sprintf("%08X", rand(2**32 - 1)); #how expensive is this? These are the approaches suggested so far. I added the last one as a combination of the others. Can we see a show of hands for the one people like the best? Can we get Hanno to modify his patch if people like one of these approaches? Can we get it tested by some people? Can we get it checked into svn? -- JT Moree