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

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 tarcieri force-pushed the password-hash/getrandom-feature branch from ae72a2a to f6e7ca7 Compare December 11, 2025 05:13
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 tarcieri force-pushed the password-hash/getrandom-feature branch from f6e7ca7 to 7be6913 Compare December 11, 2025 05:17
@tarcieri tarcieri merged commit 3b54ad0 into master Dec 11, 2025
64 checks passed
@tarcieri tarcieri deleted the password-hash/getrandom-feature branch December 11, 2025 05:20
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