From d97928bd9024a988be6c9f7ec18c0fcf93a8b9a3 Mon Sep 17 00:00:00 2001 From: ennmichael Date: Sun, 5 Mar 2023 21:43:14 +0100 Subject: [PATCH] avoid using substr in NIP-04 example --- 04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04.md b/04.md index bafc5c7..153456a 100644 --- a/04.md +++ b/04.md @@ -23,7 +23,7 @@ import crypto from 'crypto' import * as secp from 'noble-secp256k1' let sharedPoint = secp.getSharedSecret(ourPrivateKey, '02' + theirPublicKey) -let sharedX = sharedPoint.substr(2, 64) +let sharedX = sharedPoint.slice(2, 67) let iv = crypto.randomFillSync(new Uint8Array(16)) var cipher = crypto.createCipheriv(