base58Encode(data) | (Uint8Array) => string | Bitcoin-alphabet Base58 |
base58Decode(str) | (string) => Uint8Array | Inverse; throws on invalid char |
base64UrlEncode(data) | (Uint8Array | string) => string | URL-safe, no padding |
base64UrlDecode(str) | (string) => Uint8Array | |
bytesToHex(bytes) | (Uint8Array) => string | Lower-case hex |
hexToBytes(hex) | (string) => Uint8Array | Throws on odd length |
generateNonce(length?) | (number=32) => string | Returns hex; uses crypto.getRandomValues |
sha256(data) | (Uint8Array | string) => Promise<Uint8Array> | Web Crypto |
generateEd25519KeyPair() | () => Promise<{ publicKey, privateKey }> | Web Crypto Ed25519 (with HMAC-SHA-256 fallback when unavailable; see crypto.ts:206-216) |
ed25519Sign(privateKey, data) | (Uint8Array, Uint8Array) => Promise<Uint8Array> | |
ed25519Verify(publicKey, data, signature) | (Uint8Array×3) => Promise<boolean> | |
generateSecp256k1KeyPair() | () => { publicKey, privateKey } | Compressed pubkey via @noble/secp256k1 |
secp256k1Sign(privateKey, data) | (Uint8Array, Uint8Array) => Promise<Uint8Array> | SHA-256 + ECDSA, compact bytes |
secp256k1Verify(publicKey, data, signature) | (Uint8Array×3) => Promise<boolean> | |