diff options
| author | 2023-03-07 22:59:29 -0800 | |
|---|---|---|
| committer | 2023-03-07 22:59:29 -0800 | |
| commit | e16053c39ed18fb7024159d7e8bc58e5120bbf34 (patch) | |
| tree | 4316ee6b1bdf947dfd7d867f806d2a108179e8a3 /test/js/node/crypto/node-crypto.test.js | |
| parent | e389b6ef1985ffe54ecae212891e85013ece8ac0 (diff) | |
| download | bun-e16053c39ed18fb7024159d7e8bc58e5120bbf34.tar.gz bun-e16053c39ed18fb7024159d7e8bc58e5120bbf34.tar.zst bun-e16053c39ed18fb7024159d7e8bc58e5120bbf34.zip | |
"binary" is an alias of "latin1"
Fixes https://github.com/oven-sh/bun/issues/2110
Diffstat (limited to 'test/js/node/crypto/node-crypto.test.js')
| -rw-r--r-- | test/js/node/crypto/node-crypto.test.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/js/node/crypto/node-crypto.test.js b/test/js/node/crypto/node-crypto.test.js index f148f4fe9..324a2790f 100644 --- a/test/js/node/crypto/node-crypto.test.js +++ b/test/js/node/crypto/node-crypto.test.js @@ -27,3 +27,9 @@ it("web crypto", async () => { crypto.getRandomValues(bytes); await crypto.subtle.digest("SHA-256", bytes); }); + +// https://github.com/oven-sh/bun/issues/2110 +it("hash regression #2110", () => { + var s = "6fbf7e2948e0c2f29eaacac1733546a4af5ca482"; + expect(crypto.createHash("sha1").update(s, "binary").digest("hex")).toBe("e7c8b3c6f114c523d07ee355c534ee9bef3c044b"); +}); |
