Skip to content

Fix EstimateBuffer base64 size calculation#84

Merged
jgowdy-godaddy merged 1 commit intomainfrom
fix-estimate-buffer-base64
Mar 5, 2026
Merged

Fix EstimateBuffer base64 size calculation#84
jgowdy-godaddy merged 1 commit intomainfrom
fix-estimate-buffer-base64

Conversation

@jgowdy-godaddy
Copy link
Contributor

Summary

  • Replace the 1.34x float multiplier in EstimateBuffer with the exact base64 formula ceil(n/3)*4 using integer arithmetic
  • The float multiplier could underestimate by up to 3 bytes for certain input sizes due to truncation during float-to-int conversion
  • Remove the unused Base64Overhead constant

Test plan

  • All existing tests pass including round-trip encrypt/decrypt tests with varying data sizes
  • go vet passes
  • Build succeeds

🤖 Generated with Claude Code

Replace the 1.34x float multiplier with the exact base64 formula
ceil(n/3)*4 using integer arithmetic. The float multiplier could
underestimate by up to 3 bytes for certain input sizes due to
truncation during float-to-int conversion.
@jgowdy-godaddy jgowdy-godaddy merged commit 0f1ee30 into main Mar 5, 2026
4 checks passed
@jgowdy-godaddy jgowdy-godaddy deleted the fix-estimate-buffer-base64 branch March 5, 2026 15:46
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.

2 participants