From 0fb6538b51ff75ab62f09512d901b5f070d5f891 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 f727d6ff57c4e2..13eccfaf291d5a 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: