Skip to content

Commit

Permalink
crypto: remove getDefaultEncoding()
Browse files Browse the repository at this point in the history
Refs: #47182
Refs: #47869
Refs: #47943
Refs: #47998
Refs: #49140
Refs: #49145
Refs: #49167
Refs: #49169
  • Loading branch information
tniessen committed Aug 16, 2023
1 parent 7215176 commit d4a91a8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
6 changes: 0 additions & 6 deletions lib/internal/crypto/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ const {
const kHandle = Symbol('kHandle');
const kKeyObject = Symbol('kKeyObject');

// TODO(tniessen): remove all call sites and this function
function getDefaultEncoding() {
return 'buffer';
}

// This is here because many functions accepted binary strings without
// any explicit encoding in older versions of node, and we don't want
// to break them unnecessarily.
Expand Down Expand Up @@ -555,7 +550,6 @@ module.exports = {
getCiphers,
getCurves,
getDataViewOrTypedArrayBuffer,
getDefaultEncoding,
getHashes,
kHandle,
kKeyObject,
Expand Down
6 changes: 1 addition & 5 deletions lib/internal/streams/lazy_transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ const {

const stream = require('stream');

const {
getDefaultEncoding,
} = require('internal/crypto/util');

module.exports = LazyTransform;

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

if (!this._options || !this._options.defaultEncoding) {
this._writableState.defaultEncoding = getDefaultEncoding();
this._writableState.defaultEncoding = 'buffer'; // TODO(tniessen): remove
}

return this[name];
Expand Down

0 comments on commit d4a91a8

Please sign in to comment.