diff options
author | Tobias Nießen <tniessen@tnie.de> | 2023-05-16 03:22:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 01:22:33 +0000 |
commit | f36461dc6a0a334cbe8e427788377826232f3e4f (patch) | |
tree | 41a602015f441e4fb3243e11a514d0b1a340eea6 | |
parent | 29780bd6661c9aeb315c06d78881a867c8e708ef (diff) | |
download | node-new-f36461dc6a0a334cbe8e427788377826232f3e4f.tar.gz |
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>
-rw-r--r-- | lib/internal/crypto/cipher.js | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/internal/crypto/cipher.js b/lib/internal/crypto/cipher.js index 69be334b7e..a2b560d138 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') { |