-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto: fix default encoding of LazyTransform [2] #8624
Conversation
it does not belong to Streams but Crypto
Change the default encoding from latin1 to utf8 and extend the test-crypto tests.
b0c16e3
to
e689066
Compare
|
||
if (!this._options || !this._options.defaultEncoding) { | ||
this._writableState.defaultEncoding = crypto.DEFAULT_ENCODING; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to use defaultEncoding
of options in the following way?
if (this._options && this._options.defaultEncoding) {
this._writableState.defaultEncoding = this._options.defaultEncoding;
} else {
this._writableState.defaultEncoding = crypto.DEFAULT_ENCODING;
}
@@ -53,7 +53,6 @@ assert.throws(function() { | |||
crypto.createHash('sha1').update({foo: 'bar'}); | |||
}, /buffer/); | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems not necessary :)
By the way, this seems duplicated with #8611 :( |
I’m labelling this as |
@@ -21,7 +21,7 @@ const timingSafeEqual = binding.timingSafeEqual; | |||
const Buffer = require('buffer').Buffer; | |||
const stream = require('stream'); | |||
const util = require('util'); | |||
const LazyTransform = require('internal/streams/lazy_transform'); | |||
const LazyTransform = require('internal/crypto/lazy_transform'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file should probably still be in /streams
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lazy_transform internal class is only used by the crypto module. I discussed this with @zvictor at the code and learn this last weekend and we went through and made sure. I'm happy with moving it in order to make the relationship between this class and the crypto module clear.
We knew there would be some duplicates coming out of the code and learn so please bear with us @zvictor! I really appreciate you taking the time to make these changes. If this particular PR doesn't land because of the duplicate, then there are still plenty of other areas to jump in! :-) |
No problem @jasnell, it was a nice experience anyway. |
It's very useful and very appreciated! I hope you stick around and find On Wednesday, September 21, 2016, zVictor notifications@github.com wrote:
|
c133999
to
83c7a88
Compare
I'm closing this because it's been inactive for quite a while. Feel free to reopen or ping a collaborator to get it reopened if needed. |
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
crypto
Description of change
depends on #8611.
lazy_transform
out oflib/internals/streams
as it is not used by streams.lazy_transform
tests and move them to an independent file.