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 <apapirovski@mac.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
jakecastelli authored and targos committed Mar 14, 2023
1 parent 9fab228 commit 9d2532e
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 9d2532e

Please sign in to comment.