WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@tarcieri
Copy link
Member

Renames PasswordHash::hash_password to hash_password_with_salt, and adds a new getrandom-gated method to PasswordHash called hash_password, but which only takes &self and password as arguments, automatically generating a salt of the recommended length.

Renames `PasswordHash::hash_password` to `hash_password_with_salt`, and
adds a new `getrandom`-gated method to `PasswordHash` called
`hash_password`, but which only takes `&self` and `password` as
arguments, automatically generating a salt of the recommended length.
@tarcieri tarcieri merged commit c45480e into master Dec 11, 2025
73 checks passed
@tarcieri tarcieri deleted the password-hash/restore-getrandom-feature branch December 11, 2025 03:46
tarcieri added a commit to RustCrypto/password-hashes that referenced this pull request Dec 11, 2025
Companion PR to RustCrypto/traits#2123

The aforementioned traits PR renames `PasswordHash::hash_password` to
`hash_password_with_salt`, so this PR updates the method name change
accordingly.

When the `getrandom` feature is enabled, it provides a new
`PasswordHash::hash_password` which *just* accepts a password as an
argument, relying on `getrandom` to internally generate a salt.

This updates all the code examples to use the new API so users don't
have to deal with randomly generating a salt.
tarcieri added a commit to RustCrypto/password-hashes that referenced this pull request Dec 11, 2025
Companion PR to RustCrypto/traits#2123

The aforementioned traits PR renames `PasswordHash::hash_password` to
`hash_password_with_salt`, so this PR updates the method name change
accordingly.

When the `getrandom` feature is enabled, it provides a new
`PasswordHash::hash_password` which *just* accepts a password as an
argument, relying on `getrandom` to internally generate a salt.

This updates all the code examples to use the new API so users don't
have to deal with randomly generating a salt.
tarcieri added a commit to RustCrypto/password-hashes that referenced this pull request Dec 11, 2025
Companion PR to RustCrypto/traits#2123

The aforementioned traits PR renames `PasswordHash::hash_password` to
`hash_password_with_salt`, so this PR updates the method name change
accordingly.

When the `getrandom` feature is enabled, it provides a new
`PasswordHash::hash_password` which *just* accepts a password as an
argument, relying on `getrandom` to internally generate a salt.

This updates all the code examples to use the new API so users don't
have to deal with randomly generating a salt.
tarcieri added a commit to RustCrypto/password-hashes that referenced this pull request Dec 11, 2025
Companion PR to RustCrypto/traits#2123

The aforementioned traits PR renames `PasswordHash::hash_password` to
`hash_password_with_salt`, so this PR updates the method name change
accordingly.

When the `getrandom` feature is enabled, it provides a new
`PasswordHash::hash_password` which *just* accepts a password as an
argument, relying on `getrandom` to internally generate a salt.

This updates all the code examples to use the new API so users don't
have to deal with randomly generating a salt.
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.

2 participants