Skip to content

Commit

Permalink
doc: use destructing import
Browse files Browse the repository at this point in the history
PR-URL: #46847
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
jakecastelli authored and targos committed Mar 13, 2023
1 parent 5043689 commit 152cb4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ console.log(hash);
```

```cjs
const crypto = require('node:crypto');
const { createHmac } = require('node:crypto');

const secret = 'abcdefg';
const hash = crypto.createHmac('sha256', secret)
.update('I love cupcakes')
.digest('hex');
const hash = createHmac('sha256', secret)
.update('I love cupcakes')
.digest('hex');
console.log(hash);
// Prints:
// c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
Expand Down

0 comments on commit 152cb4b

Please sign in to comment.