JSFiddle - React, Tailwind, and code Playground
by heera
HTML
<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
JavaScript
function randomString(str) {
var uid = '';
str = str.replace(/\s/g, '');
for (var i = str.length; i > 0; --i) {
uid += str[Math.round(Math.random() * (str.length - 1))];
}
return uid;
}
var uid = randomString('this is some string that will generate unique UID');
console.log(uid);