Skip to content

Commit

Permalink
chore: update convertToArrayBuffer description
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho112 committed Apr 8, 2024
1 parent 29ce765 commit 30e3b34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/biometric-ed25519/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const uint8ArrayToBigInt = (uint8Array: Uint8Array) => {
return BigInt('0x' + array.map(byte => byte.toString(16).padStart(2, '0')).join(''));
};

// This function is design to convert any existing Uint8Array properties inside AuthenticatorAssertionResponse to ArrayBuffer
// This function is tries converts Uint8Array, Array or object to ArrayBuffer. Returns the original object if it doesn't match any of the aforementioned types.
export const convertToArrayBuffer = (obj) => {
if (obj instanceof Uint8Array) {
return obj.buffer.slice(obj.byteOffset, obj.byteOffset + obj.byteLength);
Expand Down

0 comments on commit 30e3b34

Please sign in to comment.