Skip to content

Commit ac8dd61

Browse files
tniessentargos
authored andcommittedMay 30, 2023
crypto: remove default encoding from cipher
Refs: #47182 PR-URL: #47998 Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 9e381cf commit ac8dd61

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed
 

‎lib/internal/crypto/cipher.js

-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const {
4545
} = require('internal/crypto/keys');
4646

4747
const {
48-
getDefaultEncoding,
4948
getArrayBufferOrView,
5049
getStringOption,
5150
kHandle,
@@ -172,10 +171,6 @@ Cipher.prototype._flush = function _flush(callback) {
172171
};
173172

174173
Cipher.prototype.update = function update(data, inputEncoding, outputEncoding) {
175-
const encoding = getDefaultEncoding();
176-
inputEncoding = inputEncoding || encoding;
177-
outputEncoding = outputEncoding || encoding;
178-
179174
if (typeof data === 'string') {
180175
validateEncoding(data, inputEncoding);
181176
} else if (!isArrayBufferView(data)) {
@@ -195,7 +190,6 @@ Cipher.prototype.update = function update(data, inputEncoding, outputEncoding) {
195190

196191

197192
Cipher.prototype.final = function final(outputEncoding) {
198-
outputEncoding = outputEncoding || getDefaultEncoding();
199193
const ret = this[kHandle].final();
200194

201195
if (outputEncoding && outputEncoding !== 'buffer') {

0 commit comments

Comments
 (0)