<!-- Sema documentation — std.binary
     Sema is a new AI-native, neurosymbolic programming language most models
     have not been trained on. Full corpus: https://sema.cortex.a2olabs.com/llms-full.txt
     Install language support: https://sema.cortex.a2olabs.com/install-skill/ -->

# std.binary

> Reflected API reference for the Sema standard-library module std.binary.

> Generated by `sema doc` from `crates/sema-runtime/assets/stdlib/sema/binary.sema`. Import with `from std.binary import …`. For a narrative introduction see [std.binary](/stdlib/binary/).

# `binary`

Bounded, digest-verified binary array decoding.

# `def decode_bytes`

```sema
def decode_bytes(payload: str, expected_sha256: str, max_items: int) -> list[int] !{}
```

**Parameters**

| name | type |
|---|---|
| `payload` | `str` |
| `expected_sha256` | `str` |
| `max_items` | `int` |

**Returns** `list[int]`

**Effects** `!{}`

# `def decode_u16_le`

```sema
def decode_u16_le(payload: str, expected_sha256: str, max_items: int) -> list[int] !{}
```

**Parameters**

| name | type |
|---|---|
| `payload` | `str` |
| `expected_sha256` | `str` |
| `max_items` | `int` |

**Returns** `list[int]`

**Effects** `!{}`

# `def decode_f32_le`

```sema
def decode_f32_le(payload: str, expected_sha256: str, max_items: int) -> list[f64] !{}
```

**Parameters**

| name | type |
|---|---|
| `payload` | `str` |
| `expected_sha256` | `str` |
| `max_items` | `int` |

**Returns** `list[f64]`

**Effects** `!{}`
