CHANGE generated password change to nnnn pin to allow easier communication for temporary work #15
This commit is contained in:
parent
60d3219f7e
commit
2489807158
1 changed files with 2 additions and 3 deletions
5
app.py
5
app.py
|
|
@ -262,10 +262,9 @@ function setPassword() {
|
|||
}
|
||||
|
||||
function genPassword() {
|
||||
const chars = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789";
|
||||
const arr = new Uint32Array(10);
|
||||
const arr = new Uint32Array(1);
|
||||
crypto.getRandomValues(arr);
|
||||
const pw = Array.from(arr, n => chars[n % chars.length]).join("");
|
||||
const pw = String(arr[0] % 10000).padStart(4, "0");
|
||||
$("#pw-input").value = pw;
|
||||
$("#pw-input").type = "text";
|
||||
$("#pw-msg").textContent = "Copy this password before setting it.";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue