mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user