This commit is contained in:
2017-08-26 17:48:10 +02:00
commit 43393cfe9c
11 changed files with 138 additions and 0 deletions

12
hash.js Normal file
View File

@@ -0,0 +1,12 @@
const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
function randomChar() {
return ALPHABET.charAt(Math.floor(Math.random()*62))
}
function createHash(len) {
var str = '';
while(str.length < len) str += randomChar();
return str;
}
module.exports = createHash;