mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
10 lines
300 B
JavaScript
10 lines
300 B
JavaScript
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;
|
|
};
|