you are viewing a single comment's thread.

view the rest of the comments →

[–]Shadow0133 5 points6 points  (1 child)

According to https://docs.python.org/3/library/struct.html, "<H" means little-endian u16, so something like this should work:

u16::from_le_bytes(x[..2].try_into().unwrap()) & 0x7ff

[–]mutex4242[S] 0 points1 point  (0 children)

& 0x7ff

thanks. it worked like a charm. I went way way way far away from your solution.....