# Adler-32 window roll

`adler32-window-roll` · version 1.0.0 · Hashing & signatures · free, no key needed

Roll an Adler-32 state forward by replacing one byte in a fixed-size window.

**Use when you need to: roll an adler32 fixed window · update checksum after sliding one byte · compute next rolling adler checksum.**

## Decide before calling

Read the [versioned contract](/v1/tools/adler32-window-roll/versions/1.0.0) and the supported scope below. Reuse `adler32-window-roll@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 `adler32-window-roll@1.0.0` for roll an adler32 fixed window. 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

- roll an adler32 fixed window
- update checksum after sliding one byte
- compute next rolling adler checksum
- replace outgoing byte in adler window
- advance fixed size adler checksum
- slide an adler byte window forward

## Not supported

- rolling by multiple bytes in one call
- validating that the outgoing byte matches stored content

## Behavior

- Adler-32 is defined by RFC 1950 section 8 with BASE 65521, initial s1=1 and s2=0; the 32-bit result is (s2 << 16) | s1.
- Every result identifies its reference as "RFC 1950 section 8; zlib 1.3.1 adler32/adler32_combine behavior".
- Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity.
- For window length N, outgoing byte x and incoming byte y: s1′=(s1-x+y) mod 65521 and s2′=(s2-N*x+s1′-1) mod 65521.

## Input

- `checksum` (string, required): pattern `^[0-9a-f]{8}$`
- `window_length` (integer, required): min 1; max 65536
- `outgoing_byte` (integer, required): min 0; max 255
- `incoming_byte` (integer, required): min 0; max 255

## Output

- `algorithm` (one of "adler32", required)
- `checksum` (string, required): pattern `^[0-9a-f]{8}$`
- `standard` (one of "RFC 1950 section 8; zlib 1.3.1 adler32/adler32_combine behavior", required)

## Limits

- max window length: 65536

## Example

Request input:

```json
{
  "checksum": "024d0127",
  "window_length": 3,
  "outgoing_byte": 97,
  "incoming_byte": 100
}
```

Response:

```json
{
  "result": {
    "algorithm": "adler32",
    "checksum": "0253012a",
    "standard": "RFC 1950 section 8; zlib 1.3.1 adler32/adler32_combine behavior"
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "adler32-window-roll",
  "version": "1.0.0",
  "input": {
    "checksum": "024d0127",
    "window_length": 3,
    "outgoing_byte": 97,
    "incoming_byte": 100
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/adler32-window-roll/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"checksum":"024d0127","window_length":3,"outgoing_byte":97,"incoming_byte":100}'
```

The machine-readable contract is at [/v1/tools/adler32-window-roll/versions/1.0.0](/v1/tools/adler32-window-roll/versions/1.0.0).

### CLI

```sh
node cli.mjs run adler32-window-roll 1.0.0 --input input.json --base-url https://computefirst.net
```

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

## Related tools

- [Adler-32 combine compute](/tools/adler32-combine-compute): Combine two Adler-32 states without rereading either byte sequence.
- [Parallelhash compute](/tools/parallelhash-compute): Compute fixed-output ParallelHash128 or ParallelHash256 with an explicit bounded block size.
- [Tuplehash compute](/tools/tuplehash-compute): Compute fixed-output TupleHash128 or TupleHash256 over an ordered tuple of byte strings.
- [Adler-32 chunks verify](/tools/adler32-chunks-verify): Verify that an ordered chunk list and a whole message have identical Adler-32 checksums.
- [Checksum manifest verify](/tools/checksum-manifest-verify): Parse a GNU/BSD checksum manifest (sha256sum -c, tagged form) and verify caller-supplied file contents against it.
- [Xxh3 128 compute](/tools/xxh3-128-compute): Compute the bit-exact XXH3 128-bit hash with a uint64 seed or public 192-byte custom secret.
