#nibble #memory #integer #representation #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

#331 in Algorithms

Download history 151/week @ 2024-06-12 159/week @ 2024-06-19 25/week @ 2024-06-26 48/week @ 2024-07-03 386/week @ 2024-07-10 363/week @ 2024-07-17 294/week @ 2024-07-24 191/week @ 2024-07-31 348/week @ 2024-08-07 636/week @ 2024-08-14 700/week @ 2024-08-21 703/week @ 2024-08-28 924/week @ 2024-09-04 638/week @ 2024-09-11 543/week @ 2024-09-18 722/week @ 2024-09-25

2,909 downloads per month
Used in trace_decoder

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–550KB