From ac8dd61fc34ebcd44ff7485316b776ad4dc42bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Tue, 16 May 2023 03:22:33 +0200 Subject: [PATCH] crypto: remove default encoding from cipher Refs: /~https://github.com/nodejs/node/pull/47182 PR-URL: /~https://github.com/nodejs/node/pull/47998 Reviewed-By: Filip Skokan Reviewed-By: Luigi Pinca --- lib/internal/crypto/cipher.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/internal/crypto/cipher.js b/lib/internal/crypto/cipher.js index 69be334b7e9748..a2b560d1382418 100644 --- a/lib/internal/crypto/cipher.js +++ b/lib/internal/crypto/cipher.js @@ -45,7 +45,6 @@ const { } = require('internal/crypto/keys'); const { - getDefaultEncoding, getArrayBufferOrView, getStringOption, kHandle, @@ -172,10 +171,6 @@ Cipher.prototype._flush = function _flush(callback) { }; Cipher.prototype.update = function update(data, inputEncoding, outputEncoding) { - const encoding = getDefaultEncoding(); - inputEncoding = inputEncoding || encoding; - outputEncoding = outputEncoding || encoding; - if (typeof data === 'string') { validateEncoding(data, inputEncoding); } else if (!isArrayBufferView(data)) { @@ -195,7 +190,6 @@ Cipher.prototype.update = function update(data, inputEncoding, outputEncoding) { Cipher.prototype.final = function final(outputEncoding) { - outputEncoding = outputEncoding || getDefaultEncoding(); const ret = this[kHandle].final(); if (outputEncoding && outputEncoding !== 'buffer') {