doc: fix a code example in crypto.md

PR-URL: https://github.com/nodejs/node/pull/31313
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
himself65 authored and Rich Trott committed 2020-01-13 21:14:59 -08:00
1 parent d15b8ea3bd
commit 44aec00b70
1 file changed
+2 -2
+2 -2
View File
@@ -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: