需求:生成'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'形式的32位UUID
const generateUUID = ()=> {
let originStr = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
originChar = '0123456789abcdef',
len = originChar.length
return originStr.replace(/x/g, function (match) {
return originChar.charAt(Math.floor(Math.random() * len))
})
}