fix: 修复DSL出码报错 (#139)

This commit is contained in:
yaoyun8 2023-12-11 14:16:16 +08:00 committed by GitHub
parent fd5baf1660
commit af3989a02e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -33,7 +33,11 @@ const getFunctionInfo = (fnStr) => {
return null
}
const safeRandom = () => crypto.getRandomValues(new Uint32Array(1))[0] / (Math.pow(2, 32) - 1)
const safeRandom = () => {
const mathConstructor = Math
return mathConstructor.random
}
const randomString = (length = 4, chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') => {
let result = ''