Download utils/string.ts from dorkai/ChatUIPro: direct link, hf CLI and curl.
- Browser
- Download file 257 Bytes
-
https://huggingface.co/spaces/dorkai/ChatUIPro/resolve/main/utils/string.ts
- Command line
-
hf download hf://spaces/dorkai/ChatUIPro/utils/string.ts
-
curl -L -o string.ts https://huggingface.co/spaces/dorkai/ChatUIPro/resolve/main/utils/string.ts
257 Bytes
| 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 | |
| } | |