GNOME-style password rating via libpwquality (as gnome-control-center does): map the 0-100 score to a 0-4 meter level and produce an actionable hint.
On a hard failure (too short, dictionary word, ...) libpwquality returns a negative code whose localized reason becomes the hint.
Built without libpwquality there is no rating to give: the level is 0 and hint is null. A
form should say so rather than leave the rating out — someone choosing a password should know it is not being judged, instead of reading
a silent absence as approval.
| password |
the password to rate |
| hint |
the rating word, or libpwquality's own advice on a hard failure |
|
the meter level, from 0 (nothing to say) to 4 (strong) |