@@ -3369,7 +3369,7 @@ void CipherBase::Update(const FunctionCallbackInfo<Value>& args) {
3369
3369
// Only copy the data if we have to, because it's a string
3370
3370
if (args[0 ]->IsString ()) {
3371
3371
StringBytes::InlineDecoder decoder;
3372
- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
3372
+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
3373
3373
return ;
3374
3374
r = cipher->Update (decoder.out (), decoder.size (), &out, &out_len);
3375
3375
} else {
@@ -3548,7 +3548,7 @@ void Hmac::HmacUpdate(const FunctionCallbackInfo<Value>& args) {
3548
3548
bool r;
3549
3549
if (args[0 ]->IsString ()) {
3550
3550
StringBytes::InlineDecoder decoder;
3551
- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
3551
+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
3552
3552
return ;
3553
3553
r = hmac->HmacUpdate (decoder.out (), decoder.size ());
3554
3554
} else {
@@ -3666,7 +3666,7 @@ void Hash::HashUpdate(const FunctionCallbackInfo<Value>& args) {
3666
3666
bool r;
3667
3667
if (args[0 ]->IsString ()) {
3668
3668
StringBytes::InlineDecoder decoder;
3669
- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
3669
+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
3670
3670
return ;
3671
3671
r = hash->HashUpdate (decoder.out (), decoder.size ());
3672
3672
} else {
@@ -3818,7 +3818,7 @@ void Sign::SignUpdate(const FunctionCallbackInfo<Value>& args) {
3818
3818
Error err;
3819
3819
if (args[0 ]->IsString ()) {
3820
3820
StringBytes::InlineDecoder decoder;
3821
- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
3821
+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
3822
3822
return ;
3823
3823
err = sign->SignUpdate (decoder.out (), decoder.size ());
3824
3824
} else {
@@ -4020,7 +4020,7 @@ void Verify::VerifyUpdate(const FunctionCallbackInfo<Value>& args) {
4020
4020
Error err;
4021
4021
if (args[0 ]->IsString ()) {
4022
4022
StringBytes::InlineDecoder decoder;
4023
- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], BINARY ))
4023
+ if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8 ))
4024
4024
return ;
4025
4025
err = verify->VerifyUpdate (decoder.out (), decoder.size ());
4026
4026
} else {
@@ -4119,12 +4119,11 @@ void Verify::VerifyFinal(const FunctionCallbackInfo<Value>& args) {
4119
4119
4120
4120
THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER (args[1 ]);
4121
4121
4122
- // BINARY works for both buffers and binary strings.
4123
- enum encoding encoding = BINARY;
4122
+ enum encoding encoding = UTF8;
4124
4123
if (args.Length () >= 3 ) {
4125
4124
encoding = ParseEncoding (env->isolate (),
4126
4125
args[2 ]->ToString (env->isolate ()),
4127
- BINARY );
4126
+ UTF8 );
4128
4127
}
4129
4128
4130
4129
ssize_t hlen = StringBytes::Size (env->isolate (), args[1 ], encoding);
0 commit comments