[API] Propagation: fix for hex conversion to binary for odd hex strings #2533
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The conversion of hex to binary did not handle odd-length inputs correctly.
The output was zero-padded on the right rather than the left. On little endian machines, the second to last entry received the 0.
For example, "78cfcfec62ae9e9" would result in:
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x78 0xcf 0xcf 0xec 0x62 0xae 0x9e 0x09
The desired output is:
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x07 0x8c 0xfc 0xfe 0xc6 0x2a 0xe9 0xe9
I have attached a toy program to reproduce the problem:
test_program.txt
Changes
Please provide a brief description of the changes here.
Corrected conversion of hex to binary for propagation
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes