Skip to content

Commit

Permalink
chore: fix typo (#508)
Browse files Browse the repository at this point in the history
* chore: update encryption.util.ts

lenght -> length

* chore: update encryption.util.spec.ts

lenght -> length
  • Loading branch information
eltociear authored Aug 16, 2024
1 parent 050b1e9 commit af91f35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down
6 changes: 3 additions & 3 deletions packages/encryption-module/src/lib/encryption.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit af91f35

Please sign in to comment.