diff options
Diffstat (limited to 'src/bitfield/bitfield.c')
-rw-r--r-- | src/bitfield/bitfield.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bitfield/bitfield.c b/src/bitfield/bitfield.c index ae1be403..3b0c5fdd 100644 --- a/src/bitfield/bitfield.c +++ b/src/bitfield/bitfield.c @@ -3,6 +3,10 @@ #include <string.h> #include <stddef.h> +uint64_t bitmask(const uint8_t bit_count) { + return (((uint64_t)0x1) << bit_count) - 1; +} + uint8_t get_nibble(const uint8_t source[], const uint8_t source_length, const uint8_t nibble_index) { uint8_t byte_index = nibble_index / 2; |