mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-21 05:16:38 +08:00
feat: init
This commit is contained in:
6
utils/string.ts
Normal file
6
utils/string.ts
Normal file
@ -0,0 +1,6 @@
|
||||
const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'
|
||||
export function randomString(length: number) {
|
||||
let result = ''
|
||||
for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)]
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user