mirror of
https://github.com/vastxie/99AI.git
synced 2025-11-12 11:43:42 +08:00
NineAI 2.4.2
This commit is contained in:
12
dist/common/utils/createRandomNonceStr.js
vendored
Normal file
12
dist/common/utils/createRandomNonceStr.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createRandomNonceStr = void 0;
|
||||
function createRandomNonceStr(len) {
|
||||
const data = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
let str = '';
|
||||
for (let i = 0; i < len; i++) {
|
||||
str += data.charAt(parseInt((Math.random() * data.length).toFixed(0), 10));
|
||||
}
|
||||
return str;
|
||||
}
|
||||
exports.createRandomNonceStr = createRandomNonceStr;
|
||||
Reference in New Issue
Block a user