mateuszchudyk / vscode-hexinspector

Visual Studio Code extension that provides fast and easy way to peek other forms of a hexadecimal value.
https://marketplace.visualstudio.com/items?itemName=mateuszchudyk.hexinspector
MIT License
15 stars 4 forks source link

Endianness Flipped #14

Open nmggithub opened 1 year ago

nmggithub commented 1 year ago

Hello!

It appears the endianness setting is used backwards.

For example, storing the decimal number 36 in two bytes would be:

little-endian: 0x2400 big-endian: 0x0024

However, in big-endian mode, only the little-endian value is read correctly, and visa versa.

EDIT: note, this does happen with the binary representations as well.

mateuszchudyk commented 1 year ago

Can you specify the specific input for which the output is wrong?

nmggithub commented 1 year ago

I listed an example in my original message.

If you type out 0x2400 in little-endian mode and mouse over it, the hover card does not say the decimal value is 36. It should say the decimal value is 36.

mateuszchudyk commented 1 year ago

Actually the endianness applies only to output. The input is always treated as a number expressed in some numeral system, not as a series of bytes. I see the separators in hex/bin I added some time ago may be misleading so I'll remove them.

nmggithub commented 1 year ago

I actually do find the separators possibly quite useful? Perhaps just a note somewhere that mentions that the endianess only applies to the output might suffice.