Skip to content

Commit

Permalink
doc: improve ECDH example
Browse files Browse the repository at this point in the history
PR-URL: #22607
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
tniessen authored and targos committed Sep 3, 2018
1 parent 516d71a commit 71502f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/crypto.md
Expand Up @@ -706,9 +706,9 @@ If the `inputEncoding` is not provided, `key` is expected to be a [`Buffer`][],
Example (uncompressing a key):

```js
const { ECDH } = require('crypto');
const { createECDH, ECDH } = require('crypto');

const ecdh = ECDH('secp256k1');
const ecdh = createECDH('secp256k1');
ecdh.generateKeys();

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

0 comments on commit 71502f2

Please sign in to comment.