From 71502f219c4588190b57cd0e439432c2f5ff642a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 3 Sep 2018 10:51:13 +0200 Subject: [PATCH] doc: improve ECDH example PR-URL: https://github.com/nodejs/node/pull/22607 Reviewed-By: Rod Vagg Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca --- doc/api/crypto.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index d00ff39014fe5b..18b4416917bae6 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -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');