summaryrefslogtreecommitdiff
path: root/doc/api/crypto.md
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2018-09-03 10:51:13 +0200
committerTobias Nießen <tniessen@tnie.de>2018-09-03 10:51:13 +0200
commit64cf96d684cc8c713c8d12daeb2b0c68ab6dd760 (patch)
treefab46fb72f9d7019de4d36ec8bc72a4eedf1a7be /doc/api/crypto.md
parent1f679107ccd6d68c296a64b3959e32880c2dcb52 (diff)
downloadandroid-node-v8-64cf96d684cc8c713c8d12daeb2b0c68ab6dd760.tar.gz
android-node-v8-64cf96d684cc8c713c8d12daeb2b0c68ab6dd760.tar.bz2
android-node-v8-64cf96d684cc8c713c8d12daeb2b0c68ab6dd760.zip
doc: improve ECDH example
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'doc/api/crypto.md')
-rw-r--r--doc/api/crypto.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/api/crypto.md b/doc/api/crypto.md
index bf643c9c6b..78e1bb4f99 100644
--- a/doc/api/crypto.md
+++ b/doc/api/crypto.md
@@ -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');