Gets the i-th bit from a byte. Should only be used with i <= 7.
| 75 | |
| 76 | // Gets the i-th bit from a byte. Should only be used with i <= 7. |
| 77 | static constexpr bool GetBitFromByte(uint8_t byte, uint8_t i) { return byte & kBitmask[i]; } |
| 78 | |
| 79 | static inline void SetBitTo(uint8_t *bits, int64_t i, bool bit_is_set) { |
| 80 | // https://graphics.stanford.edu/~seander/bithacks.html |