chore: update shortcut name input

This commit is contained in:
Steven
2023-11-20 21:35:47 +08:00
parent 6fa1c30fb7
commit 65504cf537
3 changed files with 86 additions and 17 deletions

View File

@@ -22,3 +22,13 @@ export const getFaviconWithGoogleS2 = (url: string) => {
return undefined;
}
};
export const generateRandomString = () => {
const characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
let randomString = "";
for (let i = 0; i < 6; i++) {
const randomIndex = Math.floor(Math.random() * characters.length);
randomString += characters.charAt(randomIndex);
}
return randomString;
};