> ## Documentation Index
> Fetch the complete documentation index at: https://starrycodes.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# String - Validation & Integrity

> Essential integrity checks for common formats: email structure, URL validity, custom password complexity, and unexpired JWT structure.

<Steps titleSize="h3">
  <Step title="🔒 Security Checks">
    <ResponseField name="isPasswordValid({int minLength, int minUppercase, int minNumbers, int minSpecialChars})" type="bool">
      Checks if the string meets customizable password complexity requirements (length, uppercase, numbers, special characters).

      <Expandable title="Parameters">
        <ParamField body="minLength" type="int" default="8">
          The `minimum` required `length` of the password.
        </ParamField>

        <ParamField body="minUppercase" type="int" default="1">
          The `minimum` required number of `uppercase` letters.
        </ParamField>

        <ParamField body="minNumbers" type="int" default="1">
          The `minimum` required number of `numerical` `digits`.
        </ParamField>

        <ParamField body="minSpecialChars" type="int" default="1">
          The `minimum` required number of special `characters` (!@#\$%^&\*, etc.).
        </ParamField>
      </Expandable>

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      // Requires 8+ chars, 1+ uppercase, 1+ number, 1+ special char
      print('P@sswOrd1'.isPasswordValid()); // true
      ```
    </ResponseField>

    <ResponseField name="isValidJWT()" type="bool">
      Checks if the string is a valid, unexpired JSON Web Token (JWT). Verifies structure, decodes payload, and checks the `exp` (expiry time) field.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      final validToken = 'header.payload.signature';
      print(validToken.isValidJWT()); // true (if not expired)
      ```

      <Warning>
        This does **NOT** verify the signature for authenticity.
      </Warning>
    </ResponseField>
  </Step>

  <Step title="📧 General Format Checks">
    <ResponseField name="isEmailValid()" type="bool">
      Checks if the string conforms to a standard email address format (`user@domain.tld`).

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print('test@example.com'.isEmailValid()); // true
      print('test@example'.isEmailValid()); // false
      ```
    </ResponseField>

    <ResponseField name="isValidURL()" type="bool">
      Checks if the string is a valid URL format, covering common protocols (http, https) and TLDs.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print('[https://www.google.com](https://www.google.com)'.isValidURL()); // true
      print('www.example'.isValidURL());  // false
      ```
    </ResponseField>
  </Step>
</Steps>
