mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
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: https://github.com/nodejs/node/pull/66608 Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
38a5f107bb
commit
daed8a3b7f
1 file changed
-2
@@ -33,8 +33,6 @@ function measureLegacy(n, data, method) {
|
||||
}
|
||||
|
||||
function measureSubtle(n, data, method) {
|
||||
const ec = new TextEncoder();
|
||||
data = ec.encode(data);
|
||||
const jobs = new Array(n);
|
||||
bench.start();
|
||||
for (let i = 0; i < n; i++)
|
||||
|
||||
Reference in new issue
Block a user