From 37fd7543afe5f06e3193e24cb2c3390c848faadb Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Jul 2023 09:34:26 -0400 Subject: [PATCH] fix: switch to using utf8ToBytes --- src/client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 810b211..91a2683 100644 --- a/src/client.ts +++ b/src/client.ts @@ -26,6 +26,7 @@ import { PubkeyChallengeResponse, } from "./responses/auth.js"; import isNode from "detect-node"; +import { utf8ToBytes } from "@noble/curves/abstract/utils"; type NodeReadableStreamType = typeof import("stream").Readable; @@ -148,7 +149,7 @@ export class Client { ); const signature = ed.sign( - new TextEncoder().encode(challenge.challenge), + utf8ToBytes(challenge.challenge), this._options.privateKey, );