Skip to content

Commit

Permalink
crypto: remove default encoding from cipher
Browse files Browse the repository at this point in the history
Refs: #47182
PR-URL: #47998
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
tniessen authored May 16, 2023
1 parent 29780bd commit f36461d
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/internal/crypto/cipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const {
} = require('internal/crypto/keys');

const {
getDefaultEncoding,
getArrayBufferOrView,
getStringOption,
kHandle,
Expand Down Expand Up @@ -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)) {
Expand All @@ -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') {
Expand Down

0 comments on commit f36461d

Please sign in to comment.