| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1307104 commit 0d25d05
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,14 @@ if (!common.hasCrypto) { | |||
| 8 | 8 | } | |
| 9 | 9 | var crypto = require('crypto'); | |
| 10 | 10 | ||
| 11 | + // Test for binding layer robustness | ||
| 12 | + { | ||
| 13 | + const binding = process.binding('crypto'); | ||
| 14 | + const h = new binding.Hmac(); | ||
| 15 | + // Fail to init the Hmac with an algorithm. | ||
| 16 | + assert.throws(() => h.update('hello'), /^TypeError: HmacUpdate fail$/); | ||
| 17 | + } | ||
| 18 | + | ||
| 11 | 19 | // Test HMAC | |
| 12 | 20 | var h1 = crypto.createHmac('sha1', 'Node') | |
| 13 | 21 | .update('some data') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments