mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-22 16:35:52 -05:00
avoid using substr in NIP-04 example
This commit is contained in:
parent
c74f11b7a9
commit
d97928bd90
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(
|
||||
|
|
Loading…
Reference in New Issue
Block a user