Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

generate global unique id javascript

function getUUID() {
    return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
      (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
    );
}

const guid = getUUID();

console.log(guid); // a902e165-78f1-423f-866d-b3c51610e9be
Comment

PREVIOUS NEXT
Code Example
Javascript :: angular disabled spec.ts 
Javascript :: destructuring assignment js 
Javascript :: change env location react 
Javascript :: ameca face expression code xcode 
Javascript :: form api 
Javascript :: javascript return strung 
Javascript :: Assign arrow function to a variable before exporting as module default 
Javascript :: javascript prototype chaining in stackoverf 
Javascript :: password parsley 
Javascript :: Java compile script 
Javascript :: radio button not checked when clicked react 
Javascript :: Caused by: PG::ConnectionBad: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? postgres app 
Javascript :: shopify a problem repeatedly occured on url 
Javascript :: javascript intersect two object arrays 
Javascript :: Handle Race Condition in Node Js using Mutex 
Javascript :: remove post via ajax 
Javascript :: replace html encodings node.js 
Javascript :: how to poll every n seconds in react js 
Javascript :: vanilla javascript event when reach bottom of element no jquery 
Javascript :: inherit mdn 
Javascript :: jsx expressions 
Javascript :: SH1 in react native 
Javascript :: styling font awesome icons next js 
Javascript :: _.has Creator Functions Do Not Have "Constructor" 
Javascript :: how to use session with cookie js nodejs 
Javascript :: Prototype Constructor Will Be Class or Function 
Javascript :: Backbone Sync And Fetch Example 
Javascript :: how to cut and paste an element in vanilla javascript 
Javascript :: react native picker select placeholder color 
Javascript :: mantine progress 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =