From e1fd6ae4fa212a15a4ecb33de2014a4bf3c33a5a Mon Sep 17 00:00:00 2001 From: himself65 Date: Sat, 11 Jan 2020 15:07:49 +0800 Subject: [PATCH] doc: fix a code example in crypto.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/31313 Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: James M Snell --- 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 bfe0c8bc6acbfc..4562f71e0b2343 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1364,8 +1364,8 @@ const signature = sign.sign(privateKey, 'hex'); const verify = crypto.createVerify('SHA256'); verify.write('some data to sign'); verify.end(); -console.log(verify.verify(publicKey, signature)); -// Prints: true or false +console.log(verify.verify(publicKey, signature, 'hex')); +// Prints: true ``` Example: Using the [`sign.update()`][] and [`verify.update()`][] methods: