source: trip-planner-front/node_modules/nanoid/non-secure/index.js@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 459 bytes
Line 
1let urlAlphabet =
2 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW'
3let customAlphabet = (alphabet, size) => {
4 return () => {
5 let id = ''
6 let i = size
7 while (i--) {
8 id += alphabet[(Math.random() * alphabet.length) | 0]
9 }
10 return id
11 }
12}
13let nanoid = (size = 21) => {
14 let id = ''
15 let i = size
16 while (i--) {
17 id += urlAlphabet[(Math.random() * 64) | 0]
18 }
19 return id
20}
21export { nanoid, customAlphabet }
Note: See TracBrowser for help on using the repository browser.