Skip to content

Fix allow hex input formatting - #56

Closed
makinako wants to merge 2 commits into
emn178:masterfrom
makinako:fix-allow-hex-formatting
Closed

Fix allow hex input formatting#56
makinako wants to merge 2 commits into
emn178:masterfrom
makinako:fix-allow-hex-formatting

Conversation

@makinako

Copy link
Copy Markdown

Thanks for this simple and excellent tool! I often use it for manually checking cryptographic test vectors in algorithm development and often when dealing with complicated hex input structure, I break it up to make it more human readable.
This PR just allows any kind of whitespace and the most common hex delimeters to be used in the input without an error or modification to the output calculation.

The following formatted inputs (and any combination of formatting characters) will all produce the same output:

  • 112233
  • 11 22 33 (Space)
  • 11 22 33 (Tabs)
  • 11.22.33 (Period)
  • 11:22:33 (Colon)
  • 11\22\33 (Backslash)
  • 11/22/33 (Forwardslash)
  • 11-22-33 (Hyphen)
  • 11_22_33 (Underscore)

and CR, LF or CRLF:

11
22
33

Thanks again,
Kim

@emn178

emn178 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR!

There is now a new optional mode for hex input formatting. The default hex mode remains strict, while the new mode allows formatted hex input by ignoring whitespace/separators. This should cover the use case here without changing the existing default behavior.

image

@emn178 emn178 closed this Jul 7, 2026
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