mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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 <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
29780bd666
commit
f36461dc6a
1 file changed
-6
@@ -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') {
|
||||
|
||||
Reference in new issue
Block a user