Skip to content

Commit daed8a3

Browse files
authored
benchmark: fix input passed to subtle.digest in webcrypto-digest
The data is already a random Buffer, so passing it through TextEncoder decoded it as UTF-8 and re-encoded it, making subtle.digest hash a different and larger input than createHash. Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> PR-URL: #66608 Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 38a5f10 commit daed8a3

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

‎benchmark/crypto/webcrypto-digest.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ function measureLegacy(n, data, method) {
3333
}
3434

3535
function measureSubtle(n, data, method) {
36-
const ec = new TextEncoder();
37-
data = ec.encode(data);
3836
const jobs = new Array(n);
3937
bench.start();
4038
for (let i = 0; i < n; i++)

0 commit comments

Comments
 (0)