Php code:
$uniq_id = md5(uniqid(time()));
As for ruby?
thanks.
Php code:
$uniq_id = md5(uniqid(time()));
As for ruby?
thanks.
Tannev V. wrote:
$uniq_id = md5(uniqid(time()));
Coming from Perl, I use a combination of the system time and the process
ID as the basis for a unique ID. I don’t know if Ruby has anything
ready-made for this, but it would be nice if it did.
MD5 and other hashing algorithms are susceptible to collisions, so you
won’t necessarily get a unique ID even if the original data is unique.
On Tue, Jun 17, 2008 at 4:31 AM, Tannev V. [email protected]
wrote:
As for ruby?
prompt% gem list --remote --no-update-sources | grep uuid
uuid (1.0.4)
uuid4r (0.1)
uuidtools (1.0.3)
HTH!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs