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 <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
panva committed Feb 5, 2021
1 parent 7d0f680 commit 29789f7
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 29789f7

Please sign in to comment.