Thursday, November 19, 2009

[Rails] Re: UUID

I would like to extend this discussion somewhat as I don't see any
guarantee that the id generated by "the authlogic method" will in fact
meet the requirement placed on that generated by uuid.

The UUID (Universally Unique IDentifier) has it's primary requirement
spelled out in the name. The provided id is meant to be unique across
multiple platforms without requiring any interplatform syncronization.

At it's base, authlogic provides an identifier (session key) which is
a random number. The random number source has evolved over time with
the current (inside RoR) technique provided in Ruby 1.9 being
SecureRandom. Rails 2.3.4 also provides ActiveSupport::SecureRandom
which provides equivalent functionality and defaults to Ruby1.9 if
present.

SecureRandom will use, preferentially:
ossl library random_bytes()
/dev/urandom
Window's CryptGenRandom

My problem is that I cannot find any guarantee that SecureRandom will
provide a value that meets the UUID requirement. Can anyone see what
I'm missing here?


On Nov 19, 2:28 am, Abhishek shukla <bettera...@gmail.com> wrote:
> Hello Darian,
> Thanks for your reply, Basically for generating Primary Key which is not
> just an auto increment.
>
> thanks
> abhis
>
> On Thu, Nov 19, 2009 at 12:18 PM, Darian Shimy <dsh...@gmail.com> wrote:
> > Alternative to what?  If you need ideas, take a look at how Authlogic
> > generates them in the Authlogic::Random module.
>
> > Darian Shimy
> > --
> >http://www.darianshimy.com
> >http://twitter.com/dshimy
>
> > On Wed, Nov 18, 2009 at 10:39 PM, Abhishek shukla <bettera...@gmail.com>
> > wrote:
> > > Hello Friends,
> > > Is there any better alternative for UUID? Can you please provide me a
> > link.
>
> > > Thanks
> > > Abhis
>
> > > --
>
> > > You received this message because you are subscribed to the Google Groups
> > > "Ruby on Rails: Talk" group.
> > > To post to this group, send email to rubyonrails-talk@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscribe@googlegroups.com>
> > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/rubyonrails-talk?hl=.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Ruby on Rails: Talk" group.
> > To post to this group, send email to rubyonrails-talk@googlegroups.com.
> > To unsubscribe from this group, send email to
> > rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscribe@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=.

--

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate