Javascript UUID creator

Posted on 2006-05-25
Last Modified: 2013-12-03

This is a fairly straight forward question.  I need a way to generate a UUID in javascript that is guarenteed to be unique from the instantiation of the script until it's end.  It will need to generate multiple UUIDs as well.  Thanks!
Question by:skacore
    LVL 15

    Expert Comment

    LVL 1

    Author Comment

    I need a corss browser compatible solution.
    LVL 15

    Accepted Solution

    Do you need to generate UUID's according to the standards?

    Or do you just need unique random numbers?  Do these numbers need to be a certain length?  It is certainly possible to create unique random numbers in Javascript as found here:

    You would just need to create a number in the range of values that corresponds to a 32 hexadeciaml number and then convert it to the notation you want.

    Assisted Solution

    You might check out this solution to see if it suits your needs.

    No JavaScript solution will ever be a true UUID so long as the browsers sandbox doesn't provide access to low level devices (to fetch MAC address of the NIC etc) but this is a best effort to match as much of the standard as possible in a JavaScript class.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
    Article by: DanRollins
    This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (, we'll extend the program by adding a depth-…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now