byte_arithmetic

Crates.iobyte_arithmetic
lib.rsbyte_arithmetic
version0.3.1
sourcesrc
created_at2022-09-01 23:28:48.287907
updated_at2023-01-12 22:50:19.840129
descriptionImplementation of simple arithmetic on byte-like objects
homepage
repository
max_upload_size
id657078
size11,648
Lissa Hyacinth (lissahyacinth)

documentation

https://gitlab.com/shareableai/byte_arithmetic

README

Simple Arithmetic for Byte-like Objects

Vec<u8> object that implements a subset of basic arithmetic, namely addition and integer multiplication.

Multiplication is implemented as multiplicative addition.

use byte_arithmetic::Base256;
assert_eq!(
    Base256::new(vec![1,2,3]) + Base256::new(vec![1,2,3]),
    Base256::new(vec![2,4,6])
);
assert_eq!(
    Base256::new(vec![1,2,3]) * 3,
    Base256::new(vec![3,6,9])
);
Commit count: 0

cargo fmt