Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/bcrist/zig-bithelper
- Owner: bcrist
- License: mit
- Created: 2023-10-28T05:50:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-13T03:02:13.000Z (about 1 year ago)
- Last Synced: 2024-12-01T15:37:16.472Z (2 months ago)
- Topics: util, utilities, utility-library, utils, zig, zig-library, zig-package, ziglang
- Language: Zig
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
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