File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/tools/htpasswd-generator Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import TextareaCopyable from '@/components/TextareaCopyable.vue';
6
6
const username = ref (' ' );
7
7
const password = ref (' ' );
8
8
const hashMethod = ref (' bcrypt' );
9
+ const saltCount = ref (10 );
9
10
10
11
const htpasswd = computed (() => {
11
12
if (username .value === ' ' || password .value === ' ' ) {
@@ -16,7 +17,7 @@ const htpasswd = computed(() => {
16
17
hash = md5 (password .value );
17
18
}
18
19
else {
19
- hash = hashSync (password .value , 10 );
20
+ hash = hashSync (password .value , saltCount . value );
20
21
}
21
22
return ` ${username .value }:${hash } ` ;
22
23
});
@@ -46,6 +47,10 @@ const htpasswd = computed(() => {
46
47
:options =" ['bcrypt', 'md5']"
47
48
/>
48
49
50
+ <n-form-item v-if =" hashMethod === 'bcrypt'" label =" Salt count: " label-placement =" left" label-width =" 120" >
51
+ <n-input-number v-model:value =" saltCount" placeholder =" Salt rounds..." :max =" 100" :min =" 0" w-full />
52
+ </n-form-item >
53
+
49
54
<n-divider />
50
55
51
56
<n-form-item label =" htpasswd content:" >
You can’t perform that action at this time.
0 commit comments