> ## Documentation Index
> Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# isValidBase64

> Validates if a string is a valid base64 encoded value.

## Input

* **`input`**: The original input text or data
* **`output`**: The string to validate as base64
* **`expectedOutput`**: The expected output to compare against.

<Note>
  - Any of the input variables (`input`, `output`, `expectedOutput`) can be marked as optional.
  - The returned value from the `validate` function can be a boolean, string, or a number.
</Note>

## Output

* **`Result`**: Boolean (`true` or `false`) | string | number

## Interpretation

> Assuming this evaluator returns a boolean

* **true**: The string is valid base64
* **false**: The string is not valid base64

<Note>This evaluator requires a function named <code>validate</code>.</Note>

## Example

```python theme={null}
import base64

def validate(input, output, expectedOutput):
    try:
        base64.b64decode(str(output), validate=True)
        return True
    except Exception:
        return False
```
