fix: use utf8ToBytes

This commit is contained in:
Derrick Hammer 2023-07-03 17:32:40 -04:00
parent a32dbb117a
commit a6ec4d6bed
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import jsonStringify from "json-stringify-deterministic";
import { ed25519 } from "@noble/curves/ed25519";
import { ripemd160 } from "@noble/hashes/ripemd160";
import { sha256 } from "@noble/hashes/sha256";
import { bytesToHex, hexToBytes } from "@noble/hashes/utils";
import { bytesToHex, hexToBytes, utf8ToBytes } from "@noble/hashes/utils";
const hash160 = (data: Uint8Array) => ripemd160(sha256(data));
@ -58,7 +58,7 @@ export default async (
if (
!ed25519.verify(
hexToBytes(json.signature as string),
hexToBytes(verifyPayload),
utf8ToBytes(verifyPayload),
pubkey,
)
) {