Hacker News new | ask | show | jobs
by kmarc 494 days ago
In the bcrypt crate there is an explicit method for it:

    bcrypt::non_truncating_hash() 
https://docs.rs/bcrypt/latest/bcrypt/

Funnily, TFA later also suggests that such function should exist...

1 comments

Being pedantic, TFA suggests something slightly different. The non_truncating_hash should be the default (and called something that reflects it, eg. just hash), and a separate truncating_hash function may exist. The difference (from an API design perspective) is pretty massive.