[DiscordArchive] So to get like the first 8?
[DiscordArchive] So to get like the first 8?
Archived author: Skarn • Posted: 2018-06-03T21:05:36.675000+00:00
Original source
I like python
Archived author: Kavligula • Posted: 2018-06-03T21:05:49.723000+00:00
Original source
Alright give me a minute to try and think this one down
Archived author: Skarn • Posted: 2018-06-03T21:05:49.981000+00:00
Original source
it just lacks good binary IO
Archived author: Skarn • Posted: 2018-06-03T21:06:05.450000+00:00
Original source
<@192452267683610624> thx, for the code, now I get it
Archived author: Skarn • Posted: 2018-06-03T21:06:13.737000+00:00
Original source
In fact i actually needed to understand this only
Archived author: Skarn • Posted: 2018-06-03T21:06:17.598000+00:00
Original source
other_value = 16_bit_value & (1111111100000000 >> 7) // This *should* get you the 7 bits
Archived author: Kavligula • Posted: 2018-06-03T21:06:38.980000+00:00
Original source
Wait okay
Archived author: Skarn • Posted: 2018-06-03T21:06:39.627000+00:00
Original source
the first 8 bits we can get by doing 16_bit_value >> 8
Archived author: Kavligula • Posted: 2018-06-03T21:06:45.751000+00:00
Original source
Yeah
Archived author: Kavligula • Posted: 2018-06-03T21:06:51.497000+00:00
Original source
```
# getting your message as int
i = int("140900793d002327", 16)
# getting bit at position 28 (counting from 0 from right)
i >> 28 & 1
# getting bits at position 24-27
bin(i >> 24 & 0b111)
```