crumb 0.2.1

Encode a nibble from a u64 as a u8.
Documentation
  • Coverage
  • 83.33%
    5 out of 6 items documented1 out of 5 items with examples
  • Size
  • Source code size: 4.31 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 732.29 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • mriise/crumb
    1 1 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mriise

License Crates.io Documentation

Encode an index of a nibble from a u64 as a u8.

| 4 bits | 4 bits |

| index of nibble | nibble of data |

Usage

use crumb::Crumb;

fn main() {
	let crumb = Crumb::new(1, 0b11111111).unwrap();
	assert_eq!(0b11110000u64, crumb.get_u64()); // external bits are discarded
}

Name

A nibble of something is about the size of a crumb or something like that...

Why?

Was doing some research on variable length integers and realized how nicely this fits.

For What?

Not sure!

I don't think there are too many applications for this.