fix: convert checksum to buffer

This commit is contained in:
janniks
2022-07-11 11:47:07 -04:00
committed by janniks
parent bc6c1a2081
commit 963b028d0d
2 changed files with 4 additions and 4 deletions

View File

@@ -62,7 +62,7 @@ export function base58CheckDecode(btcAddress: string): {
* @ignore
*/
export function base58Encode(hash: Buffer) {
const checksum = sha256(sha256(hash));
const checksum = Buffer.from(sha256(sha256(hash)));
return base58.encode(Buffer.concat([hash, checksum], hash.length + 4));
}

View File

@@ -4,13 +4,13 @@ import { address, ECPair, networks } from 'bitcoinjs-lib';
import bs58check from 'bs58check';
import { SECP256K1Client } from 'jsontokens';
import {
base58Encode,
compressPrivateKey,
ecSign,
getPublicKeyFromPrivate,
hashSha256Sync,
makeECPrivateKey,
publicKeyToAddress,
ecSign,
base58Encode,
compressPrivateKey,
} from '../src';
import { hashRipemd160 } from '../src/hashRipemd160';