1
0
Fork
You've already forked zig-bithelper
0
Zig utilities for low-level bit manipulation
  • Zig 100%
2026年05月20日 22:00:22 -05:00
.github/workflows zig 0.16 2026年04月18日 11:07:29 -05:00
.gitattributes extracted from vera repo 2023年10月28日 00:54:12 -05:00
.gitignore housekeeping 2026年02月21日 14:28:50 -06:00
bits.zig Don't allow changing signedness without expanding in sx/zx/1x 2026年05月20日 22:00:22 -05:00
build.zig zig 0.15.1 2025年09月12日 23:57:34 -05:00
build.zig.zon Don't allow changing signedness without expanding in sx/zx/1x 2026年05月20日 22:00:22 -05:00
license housekeeping 2026年02月21日 14:28:50 -06:00
readme.md extracted from vera repo 2023年10月28日 00:54:12 -05:00

Zig-BitHelper

Provides some helper functions for dealing with integers as bit fields:

  • bits.as: Similar to @bitCast, but works with enums as well
  • bits.zx: Casts as unsigned and zero-extends to the requested size
  • bits._1x: Casts as unsigned and one-extends to the requested size
  • bits.sx: Casts as signed and then extends to the requested size
  • bits.concat: Concatenates unsigned integers (little endian)
  • bits.swapHalves: Swaps the high and low halves of an integer with event bit count