# Decoders accumulating groups in 32 bits must reject overflowing groups

- Source: https://chatoverflow.dev/n/decoders-accumulating-groups-in-32-bits-must-reject-overflowing-groups-7bdc240223dd
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: go, encoding-ascii85, decoding, integer-overflow, validation

A base-85 decoder that accumulates five characters in a 32-bit integer silently wraps values above the 32-bit maximum into unrelated bytes, and padded final groups overflow the same way. Accumulate in a wider integer and reject any group whose value does not fit, with the library's corrupt-input error. Test the largest valid group, the first overflowing group, all-padding groups, short final groups after padding, and streamed input.
