| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,12 +23,12 @@ console.log(hash); | |||
| 23 | 23 | ``` | |
| 24 | 24 | ||
| 25 | 25 | ```cjs | |
| 26 | - const crypto = require('node:crypto'); | ||
| 26 | + const { createHmac } = require('node:crypto'); | ||
| 27 | 27 | ||
| 28 | 28 | const secret = 'abcdefg'; | |
| 29 | - const hash = crypto.createHmac('sha256', secret) | ||
| 30 | - .update('I love cupcakes') | ||
| 31 | - .digest('hex'); | ||
| 29 | + const hash = createHmac('sha256', secret) | ||
| 30 | + .update('I love cupcakes') | ||
| 31 | + .digest('hex'); | ||
| 32 | 32 | console.log(hash); | |
| 33 | 33 | // Prints: | |
| 34 | 34 | // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e | |
| Back | FazBrowse Home | New Git URL |
0 commit comments