Show HN: Bitmask.h a 300-byte C99 library for embedded bit operations After years of wrestling with verbose bit-twiddling code in embedded projects, I created bitmask.h to solve a simple problem: most bit manipulation libraries are either too heavy (STL-style), too platform-specific (compiler intrinsics), or require writing the same error-prone bit operations repeatedly. This single-header C99 library packs all essential operations—bit set/clear/check, range operations, popcount, iteration—into ~300 bytes of machine code with zero allocations. It's what I needed for microcontroller work where every byte counts, using only C99 and manual optimizations to remain completely portable. |