JavaScript create UUID
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;
}
function uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
var userID=uuid();//something like: "ec0c22fa-f909-48da-92cb-db17ecdb91c5"
Also in JavaScript:
- unable to save shipping information. please check input data. magento 2
- how to refresh the page using react
- javascript create json object from array
- how to make use of nodejs single thread to read files and attach data
- interceptor error handling angular 9
- react hook form example stack overflow
- div gets pulled to corner when resizing
- pass data from child component to parent component react native
- react search bar
- jshint es6 vscode
- nested arrays reactjs tables
- javascript audio duration property returns infinity
- puppeteer example nodejs
- get width of a dom element js
- react native length of object
- javascript variable object
- toastify js
- splice from array javascript to remove
- redux toolkit reducer
- require a json as a string
- drupal 8 get node from path alias
- Unexpected token 'export'
- create label dynamically in javascript
- How to change htm h1 from nodejs