use random eventname

This commit is contained in:
Gabe Yuan
2023-09-02 14:14:27 +08:00
parent 36739f04b3
commit c1bd6a1be6
6 changed files with 26 additions and 12 deletions

View File

@@ -116,3 +116,9 @@ export const sha256 = async (text, salt) => {
.map((b) => b.toString(16).padStart(2, "0"))
.join("");
};
/**
* 生成随机事件名称
* @returns
*/
export const genEventName = () => btoa(Math.random()).slice(3, 11);