From 4911afb7b74cfe12952c6ab1bd43c6a713510417 Mon Sep 17 00:00:00 2001 From: ShareVB Date: Sun, 13 Apr 2025 22:26:30 +0200 Subject: [PATCH] fix(Bcrypt): ensure salt is a number Fix #1558 --- components.d.ts | 3 +++ src/tools/bcrypt/bcrypt.vue | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components.d.ts b/components.d.ts index c5b8ebbb..2aae30df 100644 --- a/components.d.ts +++ b/components.d.ts @@ -273,10 +273,13 @@ declare module '@vue/runtime-core' { NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NDivider: typeof import('naive-ui')['NDivider'] NEllipsis: typeof import('naive-ui')['NEllipsis'] + NForm: typeof import('naive-ui')['NForm'] + NFormItem: typeof import('naive-ui')['NFormItem'] NginxFormatter: typeof import('./src/tools/nginx-formatter/nginx-formatter.vue')['default'] NH1: typeof import('naive-ui')['NH1'] NH3: typeof import('naive-ui')['NH3'] NIcon: typeof import('naive-ui')['NIcon'] + NInputNumber: typeof import('naive-ui')['NInputNumber'] NLayout: typeof import('naive-ui')['NLayout'] NLayoutSider: typeof import('naive-ui')['NLayoutSider'] NMenu: typeof import('naive-ui')['NMenu'] diff --git a/src/tools/bcrypt/bcrypt.vue b/src/tools/bcrypt/bcrypt.vue index d4881299..e68813c7 100644 --- a/src/tools/bcrypt/bcrypt.vue +++ b/src/tools/bcrypt/bcrypt.vue @@ -7,7 +7,7 @@ const themeVars = useThemeVars(); const input = ref(''); const saltCount = ref(10); -const hashed = computed(() => hashSync(input.value, saltCount.value)); +const hashed = computed(() => hashSync(input.value, saltCount.value || 10)); const { copy } = useCopy({ source: hashed, text: 'Hashed string copied to the clipboard' }); const compareString = ref('');