var ID = function () {
// Math.random should be unique because of its seeding algorithm.
// Convert it to base 36 (numbers + letters), and grab the first 9 characters
// after the decimal.
return '_' + Math.random().toString(36).substr(2, 9);
};
Math.random().toString(36).slice(2);
const uuid = (Math.random() + 1).toString(36).substring(2);
console.log(uuid);
const makeid = (length) => {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for ( var i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() *
charactersLength));
}
return result;
}
let uid = Date.now().toString(36) + Math.random().toString(36).substr(2)
// result string would be like "l7hgwnf0qfztje7bn3"
function uid() {
let a = new Uint32Array(3);
window.crypto.getRandomValues(a);
return (performance.now().toString(36)+Array.from(a).map(A => A.toString(36)).join("")).replace(/./g,"");
};