node/benchmark/crypto
Joyee Cheung 78c226281c crypto: implement crypto.hash()
This patch introduces a helper crypto.hash() that computes
a digest from the input at one shot. This can be 1.2-1.6x faster
than the object-based createHash() for smaller inputs (<= 5MB)
that are readily available (not streamed) and incur less memory
overhead since no intermediate objects will be created.

PR-URL: https://github.com/nodejs/node/pull/51044
Refs: https://github.com/nodejs/performance/issues/136
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
2024-02-29 12:54:51 +01:00
..
aes-gcm-throughput.js benchmark: update iterations in benchmark/crypto/aes-gcm-throughput.js 2023-12-15 15:26:23 -03:00
cipher-stream.js benchmark: add trailing commas in benchmark/crypto 2023-02-10 00:54:53 +00:00
create-hash.js benchmark: add create-hash benchmark 2023-12-15 15:26:22 -03:00
create-keyobject.js benchmark: add crypto.create*Key 2023-06-05 16:45:47 +00:00
get-ciphers.js benchmark: update iterations in benchmark/crypto/get-ciphers.js 2023-12-04 11:15:05 +01:00
hash-stream-creation.js benchmark: add trailing commas in benchmark/crypto 2023-02-10 00:54:53 +00:00
hash-stream-throughput.js benchmark: add trailing commas in benchmark/crypto 2023-02-10 00:54:53 +00:00
hkdf.js benchmark: update iterations in benchmark/crypto/hkdf.js 2023-12-04 11:15:06 +01:00
keygen.js benchmark: add trailing commas in benchmark/crypto 2023-02-10 00:54:53 +00:00
oneshot-hash.js crypto: implement crypto.hash() 2024-02-29 12:54:51 +01:00
oneshot-sign.js benchmark: refactor crypto oneshot 2023-06-05 19:00:41 +00:00
oneshot-verify.js benchmark: refactor crypto oneshot 2023-06-05 19:00:41 +00:00
randomBytes.js benchmark: update iteration and size in benchmark/crypto/randomBytes.js 2023-12-15 15:26:23 -03:00
randomInt.js benchmark: add trailing commas in benchmark/crypto 2023-02-10 00:54:53 +00:00
randomUUID.js crypto: implement randomuuid 2021-01-07 12:44:36 -08:00
rsa-encrypt-decrypt-throughput.js benchmark: add trailing commas in benchmark/crypto 2023-02-10 00:54:53 +00:00
rsa-sign-verify-throughput.js benchmark: add trailing commas in benchmark/crypto 2023-02-10 00:54:53 +00:00
webcrypto-digest.js benchmark: increase the iteration number to an appropriate value 2023-11-29 09:46:32 -03:00