mirror of
https://ghproxy.net/https://github.com/abhijitb/helix.git
synced 2025-08-28 06:26:00 +08:00
Initial commit
This commit is contained in:
commit
153a4e9fd7
345 changed files with 359185 additions and 0 deletions
21
node_modules/nanoid/non-secure/index.js
generated
vendored
Normal file
21
node_modules/nanoid/non-secure/index.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
let urlAlphabet =
|
||||
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
|
||||
let customAlphabet = (alphabet, defaultSize = 21) => {
|
||||
return (size = defaultSize) => {
|
||||
let id = ''
|
||||
let i = size | 0
|
||||
while (i--) {
|
||||
id += alphabet[(Math.random() * alphabet.length) | 0]
|
||||
}
|
||||
return id
|
||||
}
|
||||
}
|
||||
let nanoid = (size = 21) => {
|
||||
let id = ''
|
||||
let i = size | 0
|
||||
while (i--) {
|
||||
id += urlAlphabet[(Math.random() * 64) | 0]
|
||||
}
|
||||
return id
|
||||
}
|
||||
export { nanoid, customAlphabet }
|
Loading…
Add table
Add a link
Reference in a new issue