Skip to content

Commit

Permalink
fix: ensure proper ArrayBuffer type handling in padUint8ArrayWithZeros
Browse files Browse the repository at this point in the history
  • Loading branch information
1 parent b9c550b commit c433d79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/helpers/src/sha-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export function findIndexInUint8Array(array: Uint8Array, selector: Uint8Array):
}

export function padUint8ArrayWithZeros(array: Uint8Array, length: number): Uint8Array {
const result = new Uint8Array(Math.max(array.length, length));
const buffer = new ArrayBuffer(Math.max(array.length, length));
const result = new Uint8Array(buffer);
result.set(array);
return result;
}
Expand Down

0 comments on commit c433d79

Please sign in to comment.