OOctetWeave
Product

Product features · Bounded run-length expansion

01

Expand byte-and-count runs only after checking the total output limit.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Bounded run-length expansion

● ● ●OctetWeave●
A concrete starting point · Bounded run-length expansion ×
def expand_runs(runs, limit):
    if type(limit) is not int or limit < 0:
        raise ValueError("limit.invalid")
    total = 0
    for value, count in runs:
        if type(value) is not int or not 0 <= value <= 255:
            raise ValueError("byte.invalid")
        if type(count) is not int or count <= 0:
            raise ValueError("count.invalid")
        total += count
        if total > limit:
            raise ValueError("output.limit")
    return bytes(value for value, count in runs for _ in range(count))
✳Expand byte-and-count runs only after checking the total output limit.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗