Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @rzcoder
I was wondering about the choice of
write/end/read
as opposed toupdate/digest
. Were there different performance/memory characteristics between using the stream functions instead of the hash functions? Or some implementation detail between the two that I'm missing? Or did you just decide to use the stream methods because they're the new ones (totally understandable)?It appears that these are not going to be deprecated soon, the nodejs docs say "The legacy update and digest methods are also supported." https://nodejs.org/api/crypto.html#crypto_class_hash
This issue came up for me because
webpack
apparently has a problem where their implementations of the nodejs hash functions are not streams (or for some other reason don't implementwrite/end/read
-- it's a harder to decipher their code than yours). So if I wanted to use the OAEP encryption scheme (you bet I do!) withnode-rsa
andwebpack
, one of those codebases need to change.Worth noting, in
Scheme.prototype.encPad
you useupdate/digest
as well.Would you consider accepting this change?