leecannon/zig-bitjuggle
Various "bit juggling" helpers and functionality
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 with extern union to represent arbitrary bit fieldsBit - Used along with extern union to represent bit fieldsBoolean - Used along with extern union to represent boolean bit fieldsAdd the dependency to build.zig.zon:
zig fetch --save git+https://github.com/leecannon/zig-bitjuggle
Then add the following to build.zig:
const bitjuggle = b.dependency("bitjuggle", .{});
exe.root_module.addImport("bitjuggle", bitjuggle.module("bitjuggle"));