public static function checkPassword($password, $options = null)
    {
        $options = static::getOptions($options, [
            "length"    =>  8,
            "unique"    =>  4,
            "lowercase" =>  true,
            "uppercase" =>  true,
            "alpha"     =>  true,
            "numeric"   =>  true,
        ]);

        $problems = [];

        $len = mb_strlen($password);

        if ($len < $options["length"]) {
            $problems["length"] = "Passwords must be at least " . $options["length"] . " characters long";
        }

        $unique = [];
        for ($i = 0; $i < $len; ++$i) {
            $char = mb_substr($password, $i, 1);
            if (!in_array($char, $unique)) {
                $unique[] = $char;
            }
        }
        if (count($unique) < $options["unique"]) {
            $problems["unique"] = "Passwords must contain at least " . $options["unique"] . " unique characters";
        }

        if (!preg_match("/[a-z]/", $password)) {
            $problems["lowercase"] = "Passwords must contain at least 1 lowercase letter";
        }
        if (!preg_match("/[A-Z]/", $password)) {
            $problems["uppercase"] = "Passwords must contain at least 1 uppercase letter";
        }
        if (!preg_match("/[a-z]/i", $password)) {
            $problems["alpha"] = "Passwords must contain at least 1 letter";
        }
        if (!preg_match("/[0-9]/", $password)) {
            $problems["numeric"] = "Passwords must contain at least 1 number";
        }

        return $problems;
    }