On Thu, Mar 22, 2012 at 10:20 AM, 程劭非 <csf...@gmail.com> wrote:

> Random number in big enough range could replace uuid in most cases.
> But it's still not truely unique.
>
> In specified time and specified position(specified device), you can
> make sure there is only one uuid generated.
>

How do you make sure? How do you uniquely identify a device? How do you
make sure that no two devices have the same identity? How do you know where
you are and what time it is? All these have engineering answers that are
good enough for most purposes. All those answers are less reliable than
simply adding more bits to your random number -- *if* you are confident you
have a good enough source of entropy.

This is not the right list to debate this matter.


> BTW, we are using crypto.getRandomValues in our project, it works well
> until now. But I think it would be better if we have native uuid in
> JS.
>
> 2012/3/23 Mark S. Miller <erig...@google.com>:
> > What does time or position have to do with uniqueness? Why not velocity,
> > spin and charm? Seriously, given a good source of entropy, a large enough
> > random number is globally unique.
> >
> > Math.random() is not a good source of entropy, but crypto.getRandomValues
> > is. See <http://wiki.whatwg.org/wiki/Crypto>.
> >
> >
> > On Thu, Mar 22, 2012 at 3:30 AM, 程劭非 <csf...@gmail.com> wrote:
> >>
> >> UUID is not only a random Number or String. It has to contain time and
> >> position to make itself unique in the world.
> >>
> >> It looks Math.random is related to time. We have no way to involve
> >> position information to JS currently.
> >>
> >> 2012/3/16 Nuno Job <nunojobpi...@gmail.com>:
> >> > Wrong list, sorry about that :)
> >> >
> >> >
> >> > On Thu, Mar 15, 2012 at 4:34 PM, Nuno Job <nunojobpi...@gmail.com>
> >> > wrote:
> >> >>
> >> >> (~~(Math.random() * 1e9)).toString(36) + Date.now();
> >> >>
> >> >>
> >> >> On Thu, Mar 15, 2012 at 4:33 PM, Rick Waldron <
> waldron.r...@gmail.com>
> >> >> wrote:
> >> >>>
> >> >>> Axel,
> >> >>>
> >> >>> Have you ever seen
> >> >>> this? http://www.broofa.com/2008/09/javascript-uuid-function/
> >> >>>
> >> >>> I've been using this for several years
> >> >>>
> >> >>>
> >> >>> Rick
> >> >>>
> >> >>>
> >> >>> On Thu, Mar 1, 2012 at 5:45 PM, Axel Rauschmayer <a...@rauschma.de>
> >> >>> wrote:
> >> >>>>
> >> >>>> UUIDs are useful for many tasks. One cannot create good ones in
> >> >>>> JavaScript without browsers exposing more of the underlying
> platform.
> >> >>>> Would
> >> >>>> it make sense to add UUID generation to ECMAScript.next? Or is that
> >> >>>> something for a browser API?
> >> >>>>
> >> >>>> Axel
> >> >>>>
> >> >>>> --
> >> >>>> Dr. Axel Rauschmayer
> >> >>>> a...@rauschma.de
> >> >>>>
> >> >>>> home: rauschma.de
> >> >>>> twitter: twitter.com/rauschma
> >> >>>> blog: 2ality.com
> >> >>>>
> >> >>>>
> >> >>>> _______________________________________________
> >> >>>> es-discuss mailing list
> >> >>>> es-discuss@mozilla.org
> >> >>>> https://mail.mozilla.org/listinfo/es-discuss
> >> >>>>
> >> >>>
> >> >>>
> >> >>> _______________________________________________
> >> >>> es-discuss mailing list
> >> >>> es-discuss@mozilla.org
> >> >>> https://mail.mozilla.org/listinfo/es-discuss
> >> >>>
> >> >>
> >> >
> >> >
> >> > _______________________________________________
> >> > es-discuss mailing list
> >> > es-discuss@mozilla.org
> >> > https://mail.mozilla.org/listinfo/es-discuss
> >> >
> >> _______________________________________________
> >> es-discuss mailing list
> >> es-discuss@mozilla.org
> >> https://mail.mozilla.org/listinfo/es-discuss
> >
> >
> >
> >
> > --
> >     Cheers,
> >     --MarkM
>



-- 
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to