Skip to content

Commit

Permalink
doc: fix webcrypto HMAC generateKey example
Browse files Browse the repository at this point in the history
PR-URL: #37197
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
panva authored and danielleadams committed Feb 16, 2021
1 parent 655d196 commit 0702d60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc/api/webcrypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ const { subtle } = require('crypto').webcrypto;
(async function() {

const key = await subtle.generateKey({
name: 'hmac',
length: 123
name: 'HMAC',
hash: 'SHA-256',
length: 256
}, true, ['sign', 'verify']);

const digest = await subtle.sign({
name: 'hmac'
name: 'HMAC'
}, key, 'I love cupcakes');

})();
Expand Down

0 comments on commit 0702d60

Please sign in to comment.