Skip to content

Commit 64cf96d

Browse files
committed
doc: improve ECDH example
PR-URL: #22607 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 1f67910 commit 64cf96d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

doc/api/crypto.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,9 @@ If the `inputEncoding` is not provided, `key` is expected to be a [`Buffer`][],
703703
Example (uncompressing a key):
704704

705705
```js
706-
const { ECDH } = require('crypto');
706+
const { createECDH, ECDH } = require('crypto');
707707

708-
const ecdh = ECDH('secp256k1');
708+
const ecdh = createECDH('secp256k1');
709709
ecdh.generateKeys();
710710

711711
const compressedKey = ecdh.getPublicKey('hex', 'compressed');

0 commit comments

Comments
 (0)