This package contains various "bit juggling" helpers and functionality:
isBitSet- Check if a bit is setgetBit- Get the value of a bitgetBits- Get a range of bitssetBit- Set a specific bitsetBits- Set a range of bitsBitfield- Used along withextern unionto represent arbitrary bit fieldsBit- Used along withextern unionto represent bit fieldsBoolean- Used along withextern unionto represent boolean bit fields
Add the dependency to build.zig.zon:
zig fetch --save git+https://github.com/leecannon/zig-bitjuggleThen add the following to build.zig:
const bitjuggle = b.dependency("bitjuggle", .{});
exe.root_module.addImport("bitjuggle", bitjuggle.module("bitjuggle"));