| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,12 +14,13 @@ const { subtle } = require('crypto').webcrypto; | |||
| 14 | 14 | (async function() { | |
| 15 | 15 | ||
| 16 | 16 | const key = await subtle.generateKey({ | |
| 17 | - name: 'hmac', | ||
| 18 | - length: 123 | ||
| 17 | + name: 'HMAC', | ||
| 18 | + hash: 'SHA-256', | ||
| 19 | + length: 256 | ||
| 19 | 20 | }, true, ['sign', 'verify']); | |
| 20 | 21 | ||
| 21 | 22 | const digest = await subtle.sign({ | |
| 22 | - name: 'hmac' | ||
| 23 | + name: 'HMAC' | ||
| 23 | 24 | }, key, 'I love cupcakes'); | |
| 24 | 25 | ||
| 25 | 26 | })(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments