mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-09-01 05:50:47 -04:00
avoid using substr in NIP-04 example
This commit is contained in:
2
04.md
2
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(
|
||||
|
Reference in New Issue
Block a user