Avoiding the Classic "Hex String as ASCII" Base64 Bug
A classic integration bug happens when an engineer needs an AWS S3 Content-MD5 header or an HTML integrity="sha256-..." attribute from a hex checksum and feeds the 64-character hex string into a plain Base64 text encoder. That encodes 64 ASCII bytes into an 88-character Base64 string instead of encoding the 32 binary digest bytes into the required 44 characters.
ByteHelpers parses every hex nibble pair into its exact 8-bit byte value first, validates even length and hex alphabet compliance, and outputs both standard RFC 4648 Base64 and unpadded Base64URL simultaneously inside your browser.
- True Byte ParsingConverts each pair of hex nibbles into 1 binary byte before Base64 encoding (never encodes ASCII hex letters).
- Input CleanupAutomatically ignores whitespace, colons (:), hyphens (-), and 0x prefixes from OpenSSL or Wireshark dumps.
- Odd-Nibble ValidationFlags odd-length hex strings immediately so truncated keys or checksums are caught before deployment.
Why did my Content-MD5 header fail when I Base64-encoded an MD5 hex hash?
Because you likely encoded the 32 ASCII hex characters (yielding 44 Base64 chars) instead of the 16 raw binary MD5 bytes (which always yield 24 Base64 chars ending in ==).
Can I paste OpenSSL colon-separated fingerprints like AA:BB:CC?
Yes. ByteHelpers strips colons, spaces, hyphens, and 0x prefixes before grouping hex nibble pairs into bytes.