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 committed Sep 3, 2018
1 parent 1f67910 commit 64cf96d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,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 64cf96d

Please sign in to comment.