优化
This commit is contained in:
20
unpackage/dist/dev/mp-weixin/components/ChatId.js
vendored
Normal file
20
unpackage/dist/dev/mp-weixin/components/ChatId.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
function generateId() {
|
||||
const isUpperCase = Math.random() >= 0.5;
|
||||
const randomLetter = String.fromCharCode(
|
||||
Math.floor(Math.random() * 26) + (isUpperCase ? 65 : 97)
|
||||
);
|
||||
const randomPart = Array.from({ length: 5 }, () => {
|
||||
const type = Math.random();
|
||||
if (type < 0.3)
|
||||
return String.fromCharCode(Math.floor(Math.random() * 26) + 97);
|
||||
else if (type < 0.6)
|
||||
return String.fromCharCode(Math.floor(Math.random() * 26) + 65);
|
||||
else
|
||||
return Math.floor(Math.random() * 10);
|
||||
}).join("");
|
||||
const timestamp = Date.now().toString(16).slice(-4);
|
||||
return `${randomLetter}${randomPart}${timestamp}`;
|
||||
}
|
||||
exports.generateId = generateId;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/components/ChatId.js.map
|
||||
Reference in New Issue
Block a user