File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ Maybe<void> Argon2Traits::AdditionalConfig(
6060 ArrayBufferOrViewContents<char > salt (args[offset + 1 ]);
6161 ArrayBufferOrViewContents<char > secret (args[offset + 6 ]);
6262 ArrayBufferOrViewContents<char > ad (args[offset + 7 ]);
63- Utf8Value type_ (env->isolate (), args[offset + 8 ]);
63+ Utf8Value algorithm (env->isolate (), args[offset + 8 ]);
6464
6565 if (!pass.CheckSizeInt32 ()) [[unlikely]] {
6666 THROW_ERR_OUT_OF_RANGE (env, " pass is too large" );
@@ -88,11 +88,11 @@ Maybe<void> Argon2Traits::AdditionalConfig(
8888 config->secret = isAsync ? secret.ToCopy () : secret.ToByteSource ();
8989 config->ad = isAsync ? ad.ToCopy () : ad.ToByteSource ();
9090
91- if (type_. ToStringView () == " argon2i" ) {
91+ if (algorithm == " argon2i" ) {
9292 config->type = ncrypto::Argon2Type::ARGON2I;
93- } else if (type_. ToStringView () == " argon2d" ) {
93+ } else if (algorithm == " argon2d" ) {
9494 config->type = ncrypto::Argon2Type::ARGON2D;
95- } else if (type_. ToStringView () == " argon2id" ) {
95+ } else if (algorithm == " argon2id" ) {
9696 config->type = ncrypto::Argon2Type::ARGON2ID;
9797 } else {
9898 THROW_ERR_CRYPTO_INVALID_ARGON2_PARAMS (env);
You can’t perform that action at this time.
0 commit comments