#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

#813 in Algorithms

Download history 550/week @ 2024-08-24 1004/week @ 2024-08-31 684/week @ 2024-09-07 550/week @ 2024-09-14 696/week @ 2024-09-21 708/week @ 2024-09-28 424/week @ 2024-10-05 287/week @ 2024-10-12 153/week @ 2024-10-19 366/week @ 2024-10-26 417/week @ 2024-11-02 231/week @ 2024-11-09 213/week @ 2024-11-16 54/week @ 2024-11-23 101/week @ 2024-11-30 14/week @ 2024-12-07

397 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