# Utf32 check

`utf32-check` · version 1.0.0 · Numbers & math · free, no key needed

Check UTF-32 bytes and return a bounded diagnostic for alignment, BOM, endian, scalar, or noncharacter failure.

**Use when you need to: check UTF-32 validity · validate UTF-32LE bytes · validate UTF-32BE bytes.**

## Decide before calling

Read the [versioned contract](/v1/tools/utf32-check/versions/1.0.0) and the supported scope below. Reuse `utf32-check@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `utf32-check@1.0.0` for check UTF-32 validity. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- check UTF-32 validity
- validate UTF-32LE bytes
- validate UTF-32BE bytes
- diagnose malformed UTF-32
- check UTF-32 BOM policy
- find invalid UTF-32 offset

## Not supported

- repair malformed bytes
- decode invalid bytes with replacement characters

## Behavior

- Implements Unicode Standard 16.0, Unicode Encoding Schemes.
- Well-typed byte content failures return valid false and stable reason and byte offset fields.
- Canonical base64 and contract errors throw invalid_input; oversized inputs throw limit_exceeded.
- Noncharacters are scalar values but can be rejected by explicit policy.
- Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity.

## Input

- `base64` (string, required): min length 1; max length 5464
- `endian` (one of "le", "be", "auto", required)
- `bom_policy` (one of "allow", "require", "forbid", required)
- `noncharacters` (one of "allow", "reject", required)

## Output

- `valid` (boolean, required)
- `reason` (string or null, required)
- `offset` (integer or null, required): min 0
- `endian` (one of "le", "be", null, required)
- `bom` (boolean, required)
- `code_points` (integer, required): min 0; max 1024
- `standard_version` (constant "Unicode Standard 16.0, Unicode Encoding Schemes", required)

## Limits

- max input bytes: 4096
- max code points: 1024
- max diagnostics: 1

## Example

Request input:

```json
{
  "base64": "QQAAAA==",
  "endian": "le",
  "bom_policy": "allow",
  "noncharacters": "allow"
}
```

Response:

```json
{
  "result": {
    "valid": true,
    "reason": null,
    "offset": null,
    "endian": "le",
    "bom": false,
    "code_points": 1,
    "standard_version": "Unicode Standard 16.0, Unicode Encoding Schemes"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "utf32-check",
  "version": "1.0.0",
  "input": {
    "base64": "QQAAAA==",
    "endian": "le",
    "bom_policy": "allow",
    "noncharacters": "allow"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/utf32-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"base64":"QQAAAA==","endian":"le","bom_policy":"allow","noncharacters":"allow"}'
```

The machine-readable contract is at [/v1/tools/utf32-check/versions/1.0.0](/v1/tools/utf32-check/versions/1.0.0).

### CLI

```sh
node cli.mjs run utf32-check 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Bipartite coloring check](/tools/bipartite-coloring-check): Check a complete 0/1 coloring witness for graph bipartiteness and report the first certificate discrepancy.
- [Coloring validity check](/tools/coloring-validity-check): Check an indexed graph coloring certificate and report the first uncovered vertex or monochromatic edge.
- [Iso8859 semantic check](/tools/iso8859-semantic-check): Check whether every byte is defined by ISO-8859-6, ISO-8859-8, or ISO-8859-11 and report offsets.
- [Resolution proof check](/tools/resolution-proof-check): Check each binary resolution step (antecedents, pivot, resolvent) of a proof over a CNF; report the first bad step.
- [Chi square decomposition check](/tools/chi-square-decomposition-check): Check a claimed Pearson chi-square, its per-cell (O-E)^2/E terms and df exactly; returns the first wrong term.
- [Cnf assignment check](/tools/cnf-assignment-check): Check a claimed truth assignment against a DIMACS-style CNF; report the first bad literal or unsatisfied clause.
