sysmonk::squire::startup

Function complexity_checker

source
pub fn complexity_checker(password: &str) -> Result<(), String>
Expand description

Verifies the strength of a password string.

A secret is considered strong if it meets the following conditions:

  • At least 32 characters long
  • Contains at least one digit
  • Contains at least one uppercase letter
  • Contains at least one lowercase letter
  • Contains at least one special character

§Arguments

  • password - A reference to a string slice (&str) that represents the password to check.

§Returns

This function returns a Result<(), String>.

  • Ok(()) is returned if all conditions are met.
  • Err(String) is returned with an error message if any condition fails.