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
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>
  • Loading branch information
tniessen authored and UlisesGascon committed Sep 10, 2023
1 parent 4a85f70 commit 7eb10a3
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
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
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 7eb10a3

Please sign in to comment.