From a6ec4d6bedb660c80b2cfd13cddf71e913f4347e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 3 Jul 2023 17:32:40 -0400 Subject: [PATCH] fix: use utf8ToBytes --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index d077f96..0827468 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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, ) ) {