Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bcrist/zig-bithelper

Zig utilities for low-level bit manipulation
https://github.com/bcrist/zig-bithelper

util utilities utility-library utils zig zig-library zig-package ziglang

Last synced: 13 days ago
JSON representation

Zig utilities for low-level bit manipulation

Awesome Lists containing this project

README

        

# 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