Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/nanoid/non-secure/index.cjs
rd565449 r0c6b92a 1 // This alphabet uses `A-Za-z0-9_-` symbols. 2 // The order of characters is optimized for better gzip and brotli compression. 3 // References to the same file (works both for gzip and brotli): 4 // `'use`, `andom`, and `rict'` 5 // References to the brotli default dictionary: 6 // `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf` 1 7 let urlAlphabet = 2 8 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' 9 3 10 let customAlphabet = (alphabet, defaultSize = 21) => { 4 11 return (size = defaultSize) => { 5 12 let id = '' 6 let i = size 13 // A compact alternative for `for (var i = 0; i < step; i++)`. 14 let i = size | 0 7 15 while (i--) { 16 // `| 0` is more compact and faster than `Math.floor()`. 8 17 id += alphabet[(Math.random() * alphabet.length) | 0] 9 18 } … … 11 20 } 12 21 } 22 13 23 let nanoid = (size = 21) => { 14 24 let id = '' 15 let i = size 25 // A compact alternative for `for (var i = 0; i < step; i++)`. 26 let i = size | 0 16 27 while (i--) { 28 // `| 0` is more compact and faster than `Math.floor()`. 17 29 id += urlAlphabet[(Math.random() * 64) | 0] 18 30 } 19 31 return id 20 32 } 33 21 34 module.exports = { nanoid, customAlphabet }
Note:
See TracChangeset
for help on using the changeset viewer.