Skip to content

Conversation

Mikescops
Copy link
Contributor

Hello,

I tried to implement supporting a pre-defined salt for the argon2 hashing.
I'm not familiar with Rust so I struggle to manage the conversion from the Js Buffer and the Rust SaltString, there are some unrecognized chars in the buffer.

I'm not sure why but this package isn't using the types defined in the documentation so I tried a few things without success.

Let me know if it's doable, that will be really helpful for us to have the salt supported 👍

Corentin Mors added 2 commits March 3, 2023 22:22
Signed-off-by: Corentin Mors <corentin@dashlane.com>
Signed-off-by: Corentin Mors <corentin@dashlane.com>
@Mikescops
Copy link
Contributor Author

Update:

I made a second commit because I noticed the difference between hashRaw and hash.
Because hashRaw is not using the SaltString type it is possible to directly use the buffer from the JS converted to a vec.
So it works for the raw version but for the "normal" (string) one, i can't figure it out.

Copy link
Member

@Brooooooklyn Brooooooklyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Brooooooklyn Brooooooklyn changed the title Support salt input on Argon2 feat(argon2): support salt input on Argon2 Mar 5, 2023
@Brooooooklyn Brooooooklyn merged commit ca0c191 into napi-rs:main Mar 5, 2023
@Mikescops Mikescops deleted the feature/support-salt-input-argon2 branch March 5, 2023 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants