From fddba7341c3dc7763f2da0e14eee026052bb4677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sun, 14 May 2023 00:54:42 +0000 Subject: [PATCH] crypto: remove default encoding from cipher Refs: https://github.com/nodejs/node/pull/47182 --- 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') {