util_password_strength


Description:


public uint util_password_strength (string? password, out string? hint)

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.

Parameters:

password

the password to rate

hint

the rating word, or libpwquality's own advice on a hard failure

Returns:

the meter level, from 0 (nothing to say) to 4 (strong)


Namespace: GPaste
Package: gpaste-3