From 3b7b0a45e6c9c8625d548daf0cc51677936780bf Mon Sep 17 00:00:00 2001 From: sharevb Date: Sun, 14 Apr 2024 14:43:40 +0200 Subject: [PATCH] feat(htpasswd generator): allow salt rounds input (if bcrypt) --- src/tools/htpasswd-generator/htpasswd-generator.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/htpasswd-generator/htpasswd-generator.vue b/src/tools/htpasswd-generator/htpasswd-generator.vue index 6638db22..6d947ca6 100644 --- a/src/tools/htpasswd-generator/htpasswd-generator.vue +++ b/src/tools/htpasswd-generator/htpasswd-generator.vue @@ -6,6 +6,7 @@ import TextareaCopyable from '@/components/TextareaCopyable.vue'; const username = ref(''); const password = ref(''); const hashMethod = ref('bcrypt'); +const saltCount = ref(10); const htpasswd = computed(() => { if (username.value === '' || password.value === '') { @@ -16,7 +17,7 @@ const htpasswd = computed(() => { hash = md5(password.value); } else { - hash = hashSync(password.value, 10); + hash = hashSync(password.value, saltCount.value); } return `${username.value}:${hash}`; }); @@ -46,6 +47,10 @@ const htpasswd = computed(() => { :options="['bcrypt', 'md5']" /> + + + +