Generating a random GUID from Cobalt Javascript

Is there a standard method to generate a random GUID from client side Javascript? I understand that you cannot generate true GUIDs from Javascript (
http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript) but I am curious if there a standard implementation we use to generate guids.

Best Answer

  • Ryan Morlok
    Answer ✓
    Should have searched a little harder before asking:

    $/Cobalt Static Content/Development/StaticContent/site/js/v1/Core/Cobalt.js; line 5584:

    Cobalt.Hub.CreateUUID = function Cobalt$Hub$CreateUUID()

    It even references the same StackOverflow article.

Answers

  • Yeah... I'm still not so sure why that is considered part of the Hub, but it is indeed our standard function for generating GUIDs.
  • Of course it references that stackoverflow question, look at the #3 answer. :)