mirror of
https://github.com/alexgo-io/stacks.js.git
synced 2026-01-12 17:52:41 +08:00
fix: convert checksum to buffer
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user