diff options
author | Gary Ho <me@garyho.dev> | 2021-09-27 06:43:22 +0300 |
---|---|---|
committer | Filip Skokan <panva.ip@gmail.com> | 2021-09-27 16:58:08 +0300 |
commit | 8037d1749afe7736c4a1c691e8fb43f4791c8e7a (patch) | |
tree | d5f018bf782700585bd7a3f6f24dbec02b565657 /doc/api/crypto.md | |
parent | 4b030d057375e58d2e99182f6ef7aa70f6ebcf99 (diff) |
doc: fix example of crypto.generateKeySync
doc: fix the example of crypto.generateKeySync
The "options" argument must be an object.
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'doc/api/crypto.md')
-rw-r--r-- | doc/api/crypto.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 3a67cca09f5..b01203493b0 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -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 ``` @@ -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 ``` |