#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

#597 in Algorithms

Download history 316/week @ 2024-07-23 175/week @ 2024-07-30 353/week @ 2024-08-06 600/week @ 2024-08-13 696/week @ 2024-08-20 707/week @ 2024-08-27 891/week @ 2024-09-03 675/week @ 2024-09-10 519/week @ 2024-09-17 672/week @ 2024-09-24 759/week @ 2024-10-01 298/week @ 2024-10-08 264/week @ 2024-10-15 310/week @ 2024-10-22 279/week @ 2024-10-29 361/week @ 2024-11-05

1,251 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–540KB