{"uid":"cap_BpNZzODT3AheCm4UVD6Vx","slug":"pdf-lzw-decode-with-earlychange-bounded-stream-db7778e5","name":"PDF LZW Decode with EarlyChange (Bounded Stream)","description":"Decode a bounded PDF LZW byte stream with explicit EarlyChange.","url":"https://detect.halowerk.com/v1/F-TD2000-DOCUMENTS-03/pdf-lzwdecode-earlychange-clear-kwkwk-dictionary-reconstruction?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"artifact":{"type":"object","required":["pdfLzw"],"properties":{"pdfLzw":{"type":"object","required":["data","claim"],"properties":{"data":{"type":"object","required":["bytes","early_change"],"properties":{"bytes":{"type":"array","items":{"type":"integer","maximum":255,"minimum":0},"maxItems":4096,"minItems":2},"early_change":{"enum":[0,1]}},"additionalProperties":false},"claim":{"anyOf":[{"type":"null"},{"type":"object","required":["consumed_bits","decoded"],"properties":{"decoded":{"type":"array","items":{"type":"integer"},"maxItems":4096},"consumed_bits":{"type":"integer"}},"additionalProperties":false}]}},"additionalProperties":false}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_pWES1dz-avtOeH8y9huqN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Decodes a bounded PDF LZW-compressed byte stream with explicit EarlyChange control and validates or reconstructs the decoded output against an optional claim.","exampleAgentPrompt":"Can you decode this bounded PDF LZW byte stream for me — here are the raw bytes [0x80, 0x0B, ...] with early_change set to 1, and check whether the decoded output matches my claimed 42 consumed bits and decoded sequence [0x41, 0x42, 0x43]?","exampleUseCases":[{"title":"PDF stream decompression verification","prompt":"I extracted this LZW-compressed chunk from a PDF file — bytes [0x80, 0x0B, 0x60, 0x50] with early_change=1 — can you decode it and tell me what the raw bytes are?"},{"title":"LZW KwKwK edge case validation","prompt":"I have a tricky LZW byte stream that hits the KwKwK dictionary reconstruction edge case. The bytes are [0x80, 0x0C, 0x82, 0x84] with early_change=0 — can you decode it and verify my claim of 32 consumed bits and decoded output [0x41, 0x41, 0x41]?"},{"title":"PDF parser unit test regression check","prompt":"For my PDF parser regression suite, decode this LZW stream [0x80, 0x0B, 0x60] with early_change=1 and confirm whether consumed_bits=24 and decoded=[0x41, 0x42] match the correct output."}],"resultDescription":"Returns the decoded byte sequence from the LZW-compressed PDF stream, the number of consumed bits, and validation of any provided claim (decoded bytes and consumed_bits). Surfaces dictionary reconstruction details relevant to KwKwK and EarlyChange edge cases.","failureModes":["Input bytes too short (minimum 2 bytes required) or exceeds 4096-byte limit","Invalid early_change value (must be 0 or 1)","Claim mismatch: provided decoded or consumed_bits does not match actual decoding result","Malformed LZW stream causing decoding failure (e.g. missing clear code, corrupt codes)","Payment not included or insufficient USDC balance (x402 payment required)"],"whenToPreferThis":"Choose this endpoint when you need to decode a small, bounded PDF LZW byte stream (up to 4096 bytes) with explicit control over the EarlyChange parameter, especially for validating edge cases like KwKwK dictionary reconstruction or verifying your own decoder's output against a reference. Prefer this over generic LZW tools when working specifically with PDF-spec LZW streams where EarlyChange semantics matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-01T06:52:28.064Z","isFirstParty":false,"canonicalSlug":"pdf-lzw-decode-with-earlychange-bounded-stream-db7778e5"}