Uniqid(php) for ruby:

Php code:

$uniq_id = md5(uniqid(time()));

As for ruby?:frowning:

thanks.

路路路

--
Posted via http://www.ruby-forum.com/.

Tannev Vitaliy 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.

路路路

--
Posted via http://www.ruby-forum.com/\.

prompt% gem list --remote --no-update-sources | grep uuid
uuid (1.0.4)
uuid4r (0.1)
uuidtools (1.0.3)

HTH!

路路路

On Tue, Jun 17, 2008 at 4:31 AM, Tannev Vitaliy <444ert666@gmail.com> wrote:

As for ruby?:frowning:

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com