#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

#499 in Algorithms

Download history 666/week @ 2024-09-19 606/week @ 2024-09-26 634/week @ 2024-10-03 255/week @ 2024-10-10 232/week @ 2024-10-17 347/week @ 2024-10-24 379/week @ 2024-10-31 289/week @ 2024-11-07 222/week @ 2024-11-14 74/week @ 2024-11-21 104/week @ 2024-11-28 34/week @ 2024-12-05 33/week @ 2024-12-12 5/week @ 2024-12-19 1/week @ 2024-12-26 6/week @ 2025-01-02

53 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–530KB