avoid using substr in NIP-04 example

This commit is contained in:
ennmichael 2023-03-05 21:43:14 +01:00 committed by fiatjaf_
parent c74f11b7a9
commit d97928bd90

2
04.md
View File

@ -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(