From 7eb10a38ea3d8c0f132ab0817fa184a76961559f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 14 Aug 2023 15:23:37 +0000 Subject: [PATCH] crypto: remove getDefaultEncoding() Refs: https://github.com/nodejs/node/pull/47182 Refs: https://github.com/nodejs/node/pull/47869 Refs: https://github.com/nodejs/node/pull/47943 Refs: https://github.com/nodejs/node/pull/47998 Refs: https://github.com/nodejs/node/pull/49140 Refs: https://github.com/nodejs/node/pull/49145 Refs: https://github.com/nodejs/node/pull/49167 Refs: https://github.com/nodejs/node/pull/49169 PR-URL: https://github.com/nodejs/node/pull/49170 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Filip Skokan Reviewed-By: Matteo Collina Reviewed-By: Luigi Pinca --- lib/internal/crypto/util.js | 6 ------ lib/internal/streams/lazy_transform.js | 6 +----- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/internal/crypto/util.js b/lib/internal/crypto/util.js index cf044e804ad05a..51ca3f4c056fb9 100644 --- a/lib/internal/crypto/util.js +++ b/lib/internal/crypto/util.js @@ -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. @@ -555,7 +550,6 @@ module.exports = { getCiphers, getCurves, getDataViewOrTypedArrayBuffer, - getDefaultEncoding, getHashes, kHandle, kKeyObject, diff --git a/lib/internal/streams/lazy_transform.js b/lib/internal/streams/lazy_transform.js index d9d1407a819594..204ad456cd64b3 100644 --- a/lib/internal/streams/lazy_transform.js +++ b/lib/internal/streams/lazy_transform.js @@ -11,10 +11,6 @@ const { const stream = require('stream'); -const { - getDefaultEncoding, -} = require('internal/crypto/util'); - module.exports = LazyTransform; function LazyTransform(options) { @@ -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];