mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
backend: generating guests
This commit is contained in:
parent
b6bd300e1b
commit
5025a43dbd
16 changed files with 1380 additions and 167 deletions
10
backend/utils/gen.js
Normal file
10
backend/utils/gen.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
module.exports.genRandomSequence = (length = 16) => {
|
||||
let sequence = '';
|
||||
const symbols = 'ABCDEFGHIJKLMOPQRSTUVXYZabcdefghijgmlopqrstuvxyz01234567890'
|
||||
|
||||
for (let i = 0; i < length; i += 1) {
|
||||
sequence += symbols[parseInt(Math.random() * (symbols.length - 1), 10)];
|
||||
}
|
||||
|
||||
return sequence;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue