diff options
| author | Pawel Zelawski <pawel@pzelawski.com> | 2026-05-23 10:07:34 +0200 |
|---|---|---|
| committer | Pawel Zelawski <pawel@pzelawski.com> | 2026-05-23 10:07:34 +0200 |
| commit | 63805760ab36357bbd8d67aa3c510e894785335f (patch) | |
| tree | 9e1ceb7ecef3df9d85b42291875c2cddb668dff2 /src/digiid.ts | |
| parent | 3f3521cf5dad43dc537e6a56e469ccf73ae41927 (diff) | |
Diffstat (limited to 'src/digiid.ts')
| -rw-r--r-- | src/digiid.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/digiid.ts b/src/digiid.ts index d413697..95bc620 100644 --- a/src/digiid.ts +++ b/src/digiid.ts @@ -1,6 +1,6 @@ import { secp256k1 } from '@noble/curves/secp256k1.js'; -import { ripemd160 } from '@noble/hashes/ripemd160'; -import { sha256 } from '@noble/hashes/sha256'; +import { ripemd160 } from '@noble/hashes/legacy.js'; +import { sha256 } from '@noble/hashes/sha2.js'; import { randomBytes } from 'crypto'; import { DigiIDCallbackData, @@ -197,7 +197,7 @@ function recoverPublicKey(messageHash: Uint8Array, signature: Uint8Array): Uint8 // Add compressed first (more common for SegWit) results.push(compressedBytes); results.push(uncompressedBytes); - } catch (e) { + } catch { // This recovery ID didn't work, try the next one continue; } @@ -295,7 +295,7 @@ export async function _internalVerifySignature( try { // Decode base64 signature - const sigBytes = Uint8Array.from(atob(signature), c => c.charCodeAt(0)); + const sigBytes = Uint8Array.from(globalThis.atob(signature), c => c.charCodeAt(0)); if (sigBytes.length !== 65) { throw new Error('Invalid signature length'); |
