#nibble #integer #representation #memory #packed #stack #u8

no-std u4

nibble (4-bit integer) library, with packed representations

3 releases

0.1.2 Sep 5, 2024
0.1.1 Jun 21, 2024
0.1.0 Jun 16, 2024

#873 in Algorithms

Download history 342/week @ 2024-10-23 307/week @ 2024-10-30 338/week @ 2024-11-06 233/week @ 2024-11-13 101/week @ 2024-11-20 107/week @ 2024-11-27 28/week @ 2024-12-04 36/week @ 2024-12-11 10/week @ 2024-12-18 4/week @ 2025-01-01 31/week @ 2025-01-08 23/week @ 2025-01-15 15/week @ 2025-01-22 31/week @ 2025-01-29 29/week @ 2025-02-05

99 downloads per month
Used in 2 crates

MIT/Apache

47KB
1K SLoC

A deep nibble (4-bit integer) library.

[U4] is the actual nibble type, and offers common integer operations.

U4x2 packs two [U4]s in a [u8], useful for building your own primitives.

AsNibbles allows you to view e.g [u8] as a slice of [U4]s.

Stack is Heap-optimised stack of [U4] which uses a packed representation to half the memory usage of the equivalent Vec<U4>, but with a less powerful API.


lib.rs:

A deep nibble (4-bit integer) library.

[U4] is the actual nibble type, and offers common integer operations.

U4x2 packs two [U4]s in a [u8], useful for building your own primitives.

AsNibbles allows you to view e.g [u8] as a slice of [U4]s.

Stack is Heap-optimised stack of [U4] which uses a packed representation to half the memory usage of the equivalent Vec<U4>, but with a less powerful API.

Dependencies

~0–540KB