Closed demurgos closed 3 years ago
Sounds good to me.
@newpavlov you okay with the getter method approach?
Yes, sounds good.
I added accessors in 1bb21b1, but accidentally pushed master
instead of opening a PR. Whoops.
Let me know if that looks good.
Thank you very much :slightly_smiling_face:
Hi, I am currently migrating a Node application to Rust. This application uses scrypt-kdf which is itself based on node-scrypt. The kdf function in these libraries uses a different format than the one provided by this lib. I plan to eventually move to the PHC string format, but my first step is to perform a simple port.
When porting the Node algorithm, I need to write the current parameters into the output buffer. I planned to store my parameters directly as a
scrypt::Param
instance but this type does not allow to read the current values, preventing me from using it to write the Node format. My current solution is to store these parameters in my own struct, but it creates duplication. This is especially bad when usingParams::recommended
as I now have to copy the recommended values to my own crate.Would it be possible to provide read access to the current values of the parameters?
These values are
pub(crate)
currently. I understand that making them public might not be desirable as it completely breaks encapsulation (amut scrypt::Params
would allow anyone to change its values at any time). Would it then be possible to add getter methods? Something like: