removed special characters in random password function as some characters causing issues in urls

This commit is contained in:
Malte 2022-04-05 23:51:39 +02:00
parent 561a800a1a
commit 7e415a710f

View File

@ -142,13 +142,15 @@ $("button.copyUrlToClipboard").click(function () {
}); });
function randomHash() { function randomHash() {
let chars = "abcdefghijklmnopqrstuvwxyz!@#$%^&*()-+<>ABCDEFGHIJKLMNOP1234567890"; let chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
let pass = ""; var passwordLength = 16;
for (let x = 0; x < 32; x++) { var password = "";
let i = Math.floor(Math.random() * chars.length); for (var i = 0; i <= passwordLength; i++) {
pass += chars.charAt(i); var randomNumber = Math.floor(Math.random() * chars.length);
password += chars.substring(randomNumber, randomNumber +1);
} }
return pass;
return password;
} }
$("button.generateHash").click(function () { $("button.generateHash").click(function () {