Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

uuid timestamp in javascript

function uuid() {
    var dt = new Date().getTime();
    var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        var r = (dt + Math.random() * 16) % 16 | 0;
        dt = Math.floor(dt / 16);
        return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
    });
    return uuid;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: multiple value selected in select2 
Javascript :: javascript append element to array 
Javascript :: keypress event 
Javascript :: javascript insert item into array 
Javascript :: faker.js name 
Javascript :: jquey body onload 
Javascript :: npm uniqueid 
Javascript :: how to submit form using ajax 
Javascript :: rust read json file 
Javascript :: livewire set model with javascript 
Javascript :: js bundle with popper bootstrap 
Javascript :: get odd number in array 
Javascript :: datatable 
Javascript :: javascript get random number 
Javascript :: stackoverflow narrate text js 
Javascript :: prevstate in usestate 
Javascript :: cra redux 
Javascript :: how to wait a determined amount of time before doing something in js 
Javascript :: react environment 
Javascript :: MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 
Javascript :: ejs variable 
Javascript :: js remove item from array by value 
Javascript :: btn.addeventlistener 
Javascript :: how to split two digit number in javascript 
Javascript :: avascript sum of arguments 
Javascript :: Both npm and yarn have created lockfiles for this application, 
Javascript :: js get parameters 
Javascript :: get last element in an array jqury 
Javascript :: how to catch and throw error js 
Javascript :: remove property from javascript object 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =