Skip to content

fix bitwise Hex() adapter - #1021

Open
ahaensler wants to merge 1 commit into
construct:masterfrom
ahaensler:hex-adapter-bitwise-fix
Open

ahaensler wants to merge 1 commit into
construct:masterfrom
ahaensler:hex-adapter-bitwise-fix

Conversation

@ahaensler

Copy link
Copy Markdown
d = BitStruct(
    "number" / Hex(BitsInteger(12))
)

This generates number = 0x000000000000000000000701. There's 24 digits because the adapter uses bit length instead of byte length.

My PR patches the adapter. number = 0x701.

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.

1 participant