Skip to content

Commit

Permalink
doc: fix example of crypto.generateKeySync
Browse files Browse the repository at this point in the history
doc: fix the example of crypto.generateKeySync

The "options" argument must be an object.

PR-URL: #40225
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
  • Loading branch information
GreenSleepes authored and targos committed Oct 4, 2021
1 parent 22725f5 commit 9fa6dfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -3616,7 +3616,7 @@ const {
generateKeySync
} = await import('crypto');

const key = generateKeySync('hmac', 64);
const key = generateKeySync('hmac', { length: 64 });
console.log(key.export().toString('hex')); // e89..........41e
```

Expand All @@ -3625,7 +3625,7 @@ const {
generateKeySync,
} = require('crypto');

const key = generateKeySync('hmac', 64);
const key = generateKeySync('hmac', { length: 64 });
console.log(key.export().toString('hex')); // e89..........41e
```

Expand Down

0 comments on commit 9fa6dfb

Please sign in to comment.