Skip to content

Commit 78842cf

Browse files
tniessendebadree25
authored andcommitted
crypto: remove getDefaultEncoding()
Refs: #47182 Refs: #47869 Refs: #47943 Refs: #47998 Refs: #49140 Refs: #49145 Refs: #49167 Refs: #49169 PR-URL: #49170 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 64a5c01 commit 78842cf

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

lib/internal/crypto/util.js

-6
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ const {
7575
const kHandle = Symbol('kHandle');
7676
const kKeyObject = Symbol('kKeyObject');
7777

78-
// TODO(tniessen): remove all call sites and this function
79-
function getDefaultEncoding() {
80-
return 'buffer';
81-
}
82-
8378
// This is here because many functions accepted binary strings without
8479
// any explicit encoding in older versions of node, and we don't want
8580
// to break them unnecessarily.
@@ -555,7 +550,6 @@ module.exports = {
555550
getCiphers,
556551
getCurves,
557552
getDataViewOrTypedArrayBuffer,
558-
getDefaultEncoding,
559553
getHashes,
560554
kHandle,
561555
kKeyObject,

lib/internal/streams/lazy_transform.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ const {
1111

1212
const stream = require('stream');
1313

14-
const {
15-
getDefaultEncoding,
16-
} = require('internal/crypto/util');
17-
1814
module.exports = LazyTransform;
1915

2016
function LazyTransform(options) {
@@ -29,7 +25,7 @@ function makeGetter(name) {
2925
this._writableState.decodeStrings = false;
3026

3127
if (!this._options || !this._options.defaultEncoding) {
32-
this._writableState.defaultEncoding = getDefaultEncoding();
28+
this._writableState.defaultEncoding = 'buffer'; // TODO(tniessen): remove
3329
}
3430

3531
return this[name];

0 commit comments

Comments
 (0)