@@ -20,13 +20,14 @@ const {
20
20
const { Buffer } = require ( 'buffer' ) ;
21
21
22
22
const {
23
- ERR_CRYPTO_HASH_DIGEST_NO_UTF16 ,
24
23
ERR_CRYPTO_HASH_FINALIZED ,
25
24
ERR_CRYPTO_HASH_UPDATE_FAILED ,
26
25
ERR_INVALID_ARG_TYPE
27
26
} = require ( 'internal/errors' ) . codes ;
28
- const { validateString, validateUint32 } = require ( 'internal/validators' ) ;
29
- const { normalizeEncoding } = require ( 'internal/util' ) ;
27
+ const {
28
+ validateString,
29
+ validateUint32
30
+ } = require ( 'internal/validators' ) ;
30
31
const { isArrayBufferView } = require ( 'internal/util/types' ) ;
31
32
const LazyTransform = require ( 'internal/streams/lazy_transform' ) ;
32
33
const kState = Symbol ( 'kState' ) ;
@@ -85,8 +86,6 @@ Hash.prototype.digest = function digest(outputEncoding) {
85
86
if ( state [ kFinalized ] )
86
87
throw new ERR_CRYPTO_HASH_FINALIZED ( ) ;
87
88
outputEncoding = outputEncoding || getDefaultEncoding ( ) ;
88
- if ( normalizeEncoding ( outputEncoding ) === 'utf16le' )
89
- throw new ERR_CRYPTO_HASH_DIGEST_NO_UTF16 ( ) ;
90
89
91
90
// Explicit conversion for backward compatibility.
92
91
const ret = this [ kHandle ] . digest ( `${ outputEncoding } ` ) ;
@@ -116,8 +115,6 @@ Hmac.prototype.update = Hash.prototype.update;
116
115
Hmac . prototype . digest = function digest ( outputEncoding ) {
117
116
const state = this [ kState ] ;
118
117
outputEncoding = outputEncoding || getDefaultEncoding ( ) ;
119
- if ( normalizeEncoding ( outputEncoding ) === 'utf16le' )
120
- throw new ERR_CRYPTO_HASH_DIGEST_NO_UTF16 ( ) ;
121
118
122
119
if ( state [ kFinalized ] ) {
123
120
const buf = Buffer . from ( '' ) ;
0 commit comments