mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-11 01:28:51 +00:00
NIP-04 follow up: use new import in code sample
This commit is contained in:
2
04.md
2
04.md
@@ -20,7 +20,7 @@ Code sample for generating such an event in JavaScript:
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
import crypto from 'crypto'
|
import crypto from 'crypto'
|
||||||
import * as secp from 'noble-secp256k1'
|
import * as secp from '@noble/secp256k1'
|
||||||
|
|
||||||
let sharedPoint = secp.getSharedSecret(ourPrivateKey, '02' + theirPublicKey)
|
let sharedPoint = secp.getSharedSecret(ourPrivateKey, '02' + theirPublicKey)
|
||||||
let sharedX = sharedPoint.slice(1, 33)
|
let sharedX = sharedPoint.slice(1, 33)
|
||||||
|
|||||||
Reference in New Issue
Block a user