(no title)
n0rdy | 1 year ago
It's great to hear that Zig covered both cases. However, I'd still prefer the opposite behavior: a safe (without truncation) default `bcrypt()` and the unsafe function with the explicit name `bcryptWithTruncation()`.
My opinion is based on the assumption that the majority of the users will go with the `bcrypt()` option. Having AI "helpers" might make this statistic even worse.
Do you happen to know Zig team's reasoning behind this design choice? I'm really curious.
masklinn|1 year ago
These choices are documented in the function's docstring, but not obvious, nor do they seem encoded in a custom version.
jszymborski|1 year ago
So something like crypto.danger.bcrypt and crypto.bcryptWithTruncation
jedisct1|1 year ago
`bcryptWithTruncation()` is great for applications entirely written in Zig, but can create hashes that would not verify with other implementations.
The documentation of these functions is very explicit about the difference.
The verification function includes a `silently_truncate_password` option that is also pretty explicit.
xmprt|1 year ago