-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug report: To Base 16, From Hex and To Hex give same outputs for different inputs #1479
Comments
You can mitigate this by adding an operation to add a padding zero if the data has odd number of digits. |
Thanks for your prompt reply! Whereas this works, it does not look good. Just showing an idempotent function like From Hex and then To Hex gives also zero padding issues: Using regex expressions to solve this is a bit of overwhelming as a user. Maybe insert this regex function on the affected function (From Hex, To Hex) in the backend? |
"To/From Base" is for converting presentation of integers. I don't think it is good for "To Base" to add an extra (trailing) zero by default. If you want identical output as input, I think it is good not to apply any operations. |
I see. You are right, I did not know the formatting of any step and indeed the regex step does the job. Thanks for your work! |
Describe the bug
The title is self explanatory.
To Reproduce
For an input of 512 the output is incorrectly 0x2000 https://gchq.github.io/CyberChef/#recipe=To_Base(16)From_Hex('Auto')To_Hex('Space',0)&input=NTEy
For an input of 8192 the output is correctly 0x2000 https://gchq.github.io/CyberChef/#recipe=To_Base(16)From_Hex('Auto')To_Hex('Space',0)&input=ODE5Mg
Expected behaviour
512 in hex is 02 00, not 20 00
Screenshots
N/A
Desktop (if relevant, please complete the following information):
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: