We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9fab228 commit 9d2532eCopy full SHA for 9d2532e
doc/api/crypto.md
@@ -23,12 +23,12 @@ console.log(hash);
23
```
24
25
```cjs
26
-const crypto = require('node:crypto');
+const { createHmac } = require('node:crypto');
27
28
const secret = 'abcdefg';
29
-const hash = crypto.createHmac('sha256', secret)
30
- .update('I love cupcakes')
31
- .digest('hex');
+const hash = createHmac('sha256', secret)
+ .update('I love cupcakes')
+ .digest('hex');
32
console.log(hash);
33
// Prints:
34
// c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
0 commit comments