mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-22 16:33:29 -07:00
Update random.js
This commit is contained in:
parent
5d2965ffc5
commit
ff39de1101
1 changed files with 16 additions and 14 deletions
|
@ -7,9 +7,11 @@ module.exports = class RandomKeyGenerator {
|
||||||
|
|
||||||
// Generate a key of the given length
|
// Generate a key of the given length
|
||||||
createKey(keyLength) {
|
createKey(keyLength) {
|
||||||
var text = '';
|
let i;
|
||||||
|
let text;
|
||||||
|
text = '';
|
||||||
|
|
||||||
for (var i = 0; i < keyLength; i++) {
|
for (i = 0; i < keyLength; i++) {
|
||||||
const index = Math.floor(Math.random() * this.keyspace.length);
|
const index = Math.floor(Math.random() * this.keyspace.length);
|
||||||
text += this.keyspace.charAt(index);
|
text += this.keyspace.charAt(index);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue