-
Notifications
You must be signed in to change notification settings - Fork 134
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
Confused about big-endian vs little-endian for bitfields #46
Comments
The code doesn't work as expected for LE. Make these changes to binary_parser.js starting at line 361. (This breaks BE bitfields stuff).
|
I set seek(0) as a workaround for multi-bit fields to enforce little-endianness.
|
I'm still experiencing this issue in Could this be looked at? It means using the bit fields isn't very reliable for many users. |
I'm parsing a bitfield-encoded date, bits 15-12=month, 11-7=day, 6-0=(year-2000). The twist is the bytes are in little-endian.
Looking at the code and tests for bitfields, it looks like the algorithm is
The LE encoding for 01/07/2017 (US order) is 0x1391, but reading BE (0x9113) puts the LSB of the day at the topmost bit 15, and the MSBs of the day at bits 3-0.
How can I properly parse this date using BIT directives?
The text was updated successfully, but these errors were encountered: