Skip to content

Fix DividingCoder buffer size under-allocation for large inputs - #27

Merged
Xor-el merged 1 commit into
masterfrom
fix/dividing-coder-generous-buffer-sizes
Sep 3, 2026
Merged

Fix DividingCoder buffer size under-allocation for large inputs#27
Xor-el merged 1 commit into
masterfrom
fix/dividing-coder-generous-buffer-sizes

Conversation

@Xor-el

@Xor-el Xor-el commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Compute reduction factor as a double (log2(L)/8) and use Ceil for safe encode/decode sizes instead of a truncated 1000-scaled integer, which lost precision and under-allocated the decode buffer on long, high-value strings.

Add standalone DividingCoderTests covering edge-buffer roundtrips (0xFF, zero, leading-zero patterns) and a size-sufficiency regression guard across Base58/Base62/Base36; update the Base58 safe-char-count expectation.

Compute reduction factor as a double (log2(L)/8) and use Ceil for
safe encode/decode sizes instead of a truncated 1000-scaled integer,
which lost precision and under-allocated the decode buffer on long,
high-value strings.

Add standalone DividingCoderTests covering edge-buffer roundtrips
(0xFF, zero, leading-zero patterns) and a size-sufficiency regression
guard across Base58/Base62/Base36; update the Base58 safe-char-count
expectation.
@Xor-el
Xor-el merged commit f389213 into master Sep 3, 2026
24 checks passed
@Xor-el
Xor-el deleted the fix/dividing-coder-generous-buffer-sizes branch September 3, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant