Expand description
Easily hash and verify passwords using bcrypt
Structs§
- Hash
Parts - A bcrypt hash result before concatenating
Enums§
- Bcrypt
Error - All the errors we can encounter while hashing/verifying passwords
- Version
- BCrypt hash version https://en.wikipedia.org/wiki/Bcrypt#Versioning_history
Constants§
Functions§
- bcrypt
- hash
- Generates a password hash using the cost given. The salt is generated randomly using the OS randomness
- hash_
bytes - Generates a password hash using the cost given, returning a fixed-size stack buffer. The salt is generated randomly using the OS randomness. The returned buffer is always exactly 60 bytes of valid UTF-8 (version 2b format).
- hash_
with_ result - Generates a password hash using the cost given. The salt is generated randomly using the OS randomness. The function returns a result structure and allows to format the hash in different versions.
- hash_
with_ salt - Generates a password given a hash and a cost. The function returns a result structure and allows to format the hash in different versions.
- hash_
with_ salt_ bytes - Generates a password given a hash and a cost, returning a fixed-size stack buffer. The returned buffer is always exactly 60 bytes of valid UTF-8 (version 2b format).
- non_
truncating_ hash - Generates a password hash using the cost given. The salt is generated randomly using the OS randomness Will return BcryptError::Truncation if password is longer than 72 bytes
- non_
truncating_ hash_ bytes - Generates a password hash using the cost given, returning a fixed-size stack buffer. The salt is generated randomly using the OS randomness. The returned buffer is always exactly 60 bytes of valid UTF-8 (version 2b format). Will return BcryptError::Truncation if password is longer than 72 bytes
- non_
truncating_ hash_ with_ result - Generates a password hash using the cost given. The salt is generated randomly using the OS randomness. The function returns a result structure and allows to format the hash in different versions. Will return BcryptError::Truncation if password is longer than 72 bytes
- non_
truncating_ hash_ with_ salt - Generates a password given a hash and a cost. The function returns a result structure and allows to format the hash in different versions. Will return BcryptError::Truncation if password is longer than 72 bytes
- non_
truncating_ hash_ with_ salt_ bytes - Generates a password given a hash and a cost, returning a fixed-size stack buffer. The returned buffer is always exactly 60 bytes of valid UTF-8 (version 2b format). Will return BcryptError::Truncation if password is longer than 72 bytes
- non_
truncating_ verify - Verify that a password is equivalent to the hash provided.
Only use this if you are only using
non_truncating_hashto generate the hash. It will return an error for inputs that will work if generated from other sources. - verify
- Verify that a password is equivalent to the hash provided
Type Aliases§
- Bcrypt
Result - Library generic result type.