first push

This commit is contained in:
2025-10-13 18:09:01 +02:00
parent aa38e520f0
commit 2e59c1f5e7
19 changed files with 1719 additions and 1 deletions

15
lib/key_generator.js Normal file
View File

@@ -0,0 +1,15 @@
var KeyGenerator = function() {
this.keyspace = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
};
KeyGenerator.prototype.createKey = function(keyLength) {
var key = '';
var index;
for (var i = 0; i < keyLength; i++) {
index = Math.floor(Math.random() * this.keyspace.length);
key += this.keyspace.charAt(index);
}
return key;
};
module.exports = KeyGenerator;