Skip to content

Commit f3ecafa

Browse files
authored
doc: mention crypto.hash() for better perf
Signed-off-by: Steven <steven@ceriously.com> PR-URL: #63420 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent c76aff4 commit f3ecafa

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

doc/api/crypto.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3806,6 +3806,8 @@ behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option
38063806
specifies the desired output length in bytes. It is required for XOF hash
38073807
functions without a default output length.
38083808

3809+
When the data is small (< 5MB) and readily available, [`crypto.hash()`][] is usually faster.
3810+
38093811
The `algorithm` is dependent on the available algorithms supported by the
38103812
version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
38113813
On recent releases of OpenSSL, `openssl list -digest-algorithms` will
@@ -7018,6 +7020,7 @@ See the [list of SSL OP Flags][] for details.
70187020
[`crypto.getCurves()`]: #cryptogetcurves
70197021
[`crypto.getDiffieHellman()`]: #cryptogetdiffiehellmangroupname
70207022
[`crypto.getHashes()`]: #cryptogethashes
7023+
[`crypto.hash()`]: #cryptohashalgorithm-data-options
70217024
[`crypto.privateDecrypt()`]: #cryptoprivatedecryptprivatekey-buffer
70227025
[`crypto.privateEncrypt()`]: #cryptoprivateencryptprivatekey-buffer
70237026
[`crypto.publicDecrypt()`]: #cryptopublicdecryptkey-buffer

0 commit comments

Comments
 (0)