getpass

Password Input Helpers

Functions

FunctionDescription
_getpass_byte_atInternal byte reader.
getpass_maskReplace each byte of input with ‘*’ (42). Returns len.
getpass_validate_lenCheck if len is between min and max inclusive. Returns 1 if valid.
_getpass_has_digitInternal: check if password has at least one digit.
_getpass_has_upperInternal: check if password has at least one uppercase letter.
_getpass_has_lowerInternal: check if password has at least one lowercase letter.
_getpass_has_specialInternal: check if password has at least one special character.
getpass_strengthCompute password strength score (0-4). +1 for length >= 8, +1 for digit, +1 f…

Details

_getpass_byte_at

fn _getpass_byte_at(buf: &i8, idx: i64) -> i64

Internal byte reader.

getpass_mask

fn getpass_mask(input: &i8, len: i64, out: &i8) -> i64

Replace each byte of input with ‘*’ (42). Returns len.

getpass_validate_len

fn getpass_validate_len(len: i64, min: i64, max: i64) -> i64

Check if len is between min and max inclusive. Returns 1 if valid.

_getpass_has_digit

fn _getpass_has_digit(buf: &i8, len: i64) -> i64

Internal: check if password has at least one digit.

_getpass_has_upper

fn _getpass_has_upper(buf: &i8, len: i64) -> i64

Internal: check if password has at least one uppercase letter.

_getpass_has_lower

fn _getpass_has_lower(buf: &i8, len: i64) -> i64

Internal: check if password has at least one lowercase letter.

_getpass_has_special

fn _getpass_has_special(buf: &i8, len: i64) -> i64

Internal: check if password has at least one special character.

getpass_strength

fn getpass_strength(buf: &i8, len: i64) -> i64

Compute password strength score (0-4). +1 for length >= 8, +1 for digit, +1 for mixed case, +1 for special char.