diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/crypto/hash.js | 6 | ||||
-rw-r--r-- | lib/internal/errors.js | 2 |
2 files changed, 0 insertions, 8 deletions
diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index 7e4a83ca93..eccfb44569 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -20,14 +20,12 @@ const { const { Buffer } = require('buffer'); const { - ERR_CRYPTO_HASH_DIGEST_NO_UTF16, ERR_CRYPTO_HASH_FINALIZED, ERR_CRYPTO_HASH_UPDATE_FAILED, ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; const { validateEncoding, validateString, validateUint32 } = require('internal/validators'); -const { normalizeEncoding } = require('internal/util'); const { isArrayBufferView } = require('internal/util/types'); const LazyTransform = require('internal/streams/lazy_transform'); const kState = Symbol('kState'); @@ -90,8 +88,6 @@ Hash.prototype.digest = function digest(outputEncoding) { if (state[kFinalized]) throw new ERR_CRYPTO_HASH_FINALIZED(); outputEncoding = outputEncoding || getDefaultEncoding(); - if (normalizeEncoding(outputEncoding) === 'utf16le') - throw new ERR_CRYPTO_HASH_DIGEST_NO_UTF16(); // Explicit conversion for backward compatibility. const ret = this[kHandle].digest(`${outputEncoding}`); @@ -121,8 +117,6 @@ Hmac.prototype.update = Hash.prototype.update; Hmac.prototype.digest = function digest(outputEncoding) { const state = this[kState]; outputEncoding = outputEncoding || getDefaultEncoding(); - if (normalizeEncoding(outputEncoding) === 'utf16le') - throw new ERR_CRYPTO_HASH_DIGEST_NO_UTF16(); if (state[kFinalized]) { const buf = Buffer.from(''); diff --git a/lib/internal/errors.js b/lib/internal/errors.js index eb3c435b20..3382d137f7 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -749,8 +749,6 @@ E('ERR_CRYPTO_FIPS_FORCED', 'Cannot set FIPS mode, it was forced with --force-fips at startup.', Error); E('ERR_CRYPTO_FIPS_UNAVAILABLE', 'Cannot set FIPS mode in a non-FIPS build.', Error); -E('ERR_CRYPTO_HASH_DIGEST_NO_UTF16', 'hash.digest() does not support UTF-16', - Error); E('ERR_CRYPTO_HASH_FINALIZED', 'Digest already called', Error); E('ERR_CRYPTO_HASH_UPDATE_FAILED', 'Hash update failed', Error); E('ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS', 'The selected key encoding %s %s.', |