From af91f35df0d4f7b19ee634584b03f15d090535b6 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Fri, 16 Aug 2024 22:20:08 +0900 Subject: [PATCH] chore: fix typo (#508) * chore: update encryption.util.ts lenght -> length * chore: update encryption.util.spec.ts lenght -> length --- .../src/lib/__test__/unit/encryption.util.spec.ts | 2 +- packages/encryption-module/src/lib/encryption.util.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/encryption-module/src/lib/__test__/unit/encryption.util.spec.ts b/packages/encryption-module/src/lib/__test__/unit/encryption.util.spec.ts index 2d6cc0801..e548b4049 100644 --- a/packages/encryption-module/src/lib/__test__/unit/encryption.util.spec.ts +++ b/packages/encryption-module/src/lib/__test__/unit/encryption.util.spec.ts @@ -13,7 +13,7 @@ describe('generateKeyEncryptionKey', () => { }) it('generates a kek with a custom length', () => { - const kek = generateKeyEncryptionKey(password, salt, { lenght: 64 }) + const kek = generateKeyEncryptionKey(password, salt, { length: 64 }) expect(kek.length).toEqual(64) }) diff --git a/packages/encryption-module/src/lib/encryption.util.ts b/packages/encryption-module/src/lib/encryption.util.ts index 97445bf54..8bcd76718 100644 --- a/packages/encryption-module/src/lib/encryption.util.ts +++ b/packages/encryption-module/src/lib/encryption.util.ts @@ -13,10 +13,10 @@ export const isolateBuffer = (buffer: Buffer): Buffer => { export const generateKeyEncryptionKey = ( password: string, salt: string, - options?: { iterations?: number; lenght: number } + options?: { iterations?: number; length: number } ): Buffer => { - const iterations = options?.lenght || 1_000_000 - const length = options?.lenght || 32 + const iterations = options?.length || 1_000_000 + const length = options?.length || 32 const kek = pbkdf2Sync(password.normalize(), salt.normalize(), iterations, length, 'sha256')