aboutsummaryrefslogtreecommitdiff
path: root/www/index.js
diff options
context:
space:
mode:
authorgabrielgio <gabriel.giovanini@pm.me>2022-03-25 18:55:37 +0100
committergabrielgio <gabriel.giovanini@pm.me>2022-03-25 18:55:37 +0100
commit51b4460935bb04d26d368810aa5c330fb9bcccdd (patch)
tree1b4e72c4082bb1d3c363926cb0b058ff511da46a /www/index.js
parent60e47b9cb1127042c5567c2632936295fd210be5 (diff)
downloadgenpass-51b4460935bb04d26d368810aa5c330fb9bcccdd.tar.gz
genpass-51b4460935bb04d26d368810aa5c330fb9bcccdd.tar.bz2
genpass-51b4460935bb04d26d368810aa5c330fb9bcccdd.zip
ref: Add actual pass generator function
Modify `generate` function to actually generate usable.
Diffstat (limited to 'www/index.js')
-rw-r--r--www/index.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/www/index.js b/www/index.js
index c9baaf8..e25ec3a 100644
--- a/www/index.js
+++ b/www/index.js
@@ -1,7 +1,9 @@
import * as wasm from "genpass";
-function generatePassword() {
- document.getElementById("password").innerHTML = wasm.generate();
-}
+const LEN = 32;
-document.getElementById("generate").onclick = generatePassword
+document.getElementById("password").innerHTML = wasm.generate(LEN);
+
+document.getElementById("generate").onclick = (function () {
+ document.getElementById("password").innerHTML = wasm.generate(LEN);
+});