UNPKG

antelope-webauthn

Version:

A WebAuthn.io crypto utility for generating signatures, creating public keys, and verifying them, designed for Antelope-based blockchains such as Vaulta, WAX, and other related platforms. This package provides convenient tools to handle key pair generatio

12 lines (11 loc) 475 B
export const array_to_number = (array) => BigInt(`0x${array.reduce((acc, i) => (acc += i.toString(16).padStart(2, "0")), "")}`); export function bigint_to_array(bigint) { const length = Math.ceil(bigint.toString(2).length / 8); const buffer = new ArrayBuffer(length); const view = new DataView(buffer); for (let i = length - 1; i >= 0; i--) { view.setUint8(i, Number(bigint & 0xffn)); bigint >>= 8n; } return new Uint8Array(buffer); }