Spaces:
Paused
Paused
Download node_modules/nanoid/non-secure/index.js from PShowdown/Pokemon_server: direct link, hf CLI and curl.
- Browser
- Download file 844 Bytes
-
https://huggingface.co/spaces/PShowdown/Pokemon_server/resolve/main/node_modules/nanoid/non-secure/index.js
- Command line
-
hf download hf://spaces/PShowdown/Pokemon_server/node_modules/nanoid/non-secure/index.js
-
curl -L -o index.js https://huggingface.co/spaces/PShowdown/Pokemon_server/resolve/main/node_modules/nanoid/non-secure/index.js
844 Bytes
| // This alphabet uses `A-Za-z0-9_-` symbols. The genetic algorithm helped | |
| // optimize the gzip compression for this alphabet. | |
| let urlAlphabet = | |
| 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW' | |
| let customAlphabet = (alphabet, size) => { | |
| return () => { | |
| let id = '' | |
| // A compact alternative for `for (var i = 0; i < step; i++)`. | |
| let i = size | |
| while (i--) { | |
| // `| 0` is more compact and faster than `Math.floor()`. | |
| id += alphabet[(Math.random() * alphabet.length) | 0] | |
| } | |
| return id | |
| } | |
| } | |
| let nanoid = (size = 21) => { | |
| let id = '' | |
| // A compact alternative for `for (var i = 0; i < step; i++)`. | |
| let i = size | |
| while (i--) { | |
| // `| 0` is more compact and faster than `Math.floor()`. | |
| id += urlAlphabet[(Math.random() * 64) | 0] | |
| } | |
| return id | |
| } | |
| export { nanoid, customAlphabet } | |