mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
doc: align to function signature
PR-URL: https://github.com/nodejs/node/pull/34930 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
This commit is contained in:
1 parent
6c91991f6c
commit
c7e3b0bcb7
1 file changed
+4
-4
+4
-4
@@ -2888,12 +2888,12 @@ or types.
|
||||
```js
|
||||
const crypto = require('crypto');
|
||||
// Using the factory defaults.
|
||||
crypto.scrypt('secret', 'salt', 64, (err, derivedKey) => {
|
||||
crypto.scrypt('password', 'salt', 64, (err, derivedKey) => {
|
||||
if (err) throw err;
|
||||
console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
|
||||
});
|
||||
// Using a custom N parameter. Must be a power of two.
|
||||
crypto.scrypt('secret', 'salt', 64, { N: 1024 }, (err, derivedKey) => {
|
||||
crypto.scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => {
|
||||
if (err) throw err;
|
||||
console.log(derivedKey.toString('hex')); // '3745e48...aa39b34'
|
||||
});
|
||||
@@ -2945,10 +2945,10 @@ or types.
|
||||
```js
|
||||
const crypto = require('crypto');
|
||||
// Using the factory defaults.
|
||||
const key1 = crypto.scryptSync('secret', 'salt', 64);
|
||||
const key1 = crypto.scryptSync('password', 'salt', 64);
|
||||
console.log(key1.toString('hex')); // '3745e48...08d59ae'
|
||||
// Using a custom N parameter. Must be a power of two.
|
||||
const key2 = crypto.scryptSync('secret', 'salt', 64, { N: 1024 });
|
||||
const key2 = crypto.scryptSync('password', 'salt', 64, { N: 1024 });
|
||||
console.log(key2.toString('hex')); // '3745e48...aa39b34'
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user