lfsr-fibo 0.1.0

Efficient pure Rust implemention of LFSR using Fibonacci representation.
Documentation
  • Coverage
  • 80%
    4 out of 5 items documented3 out of 4 items with examples
  • Size
  • Source code size: 5.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 66.0 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • acmo0/lfsr-fibo
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • acmo0

lfsr-fibo

Crates.io Total Downloads Crates.io Version

Efficient pure Rust implementation of LFSR in fibonacci representation.

Please see installation details and doc on crates.io.


Usage

This is an example of a basic usage. Let say that you want to generate 256 bits from the LFSR represented by the polynomial x^11 + x^6 + x^3 + 1 with an initial state of 10101101110, then you can use this crate in the folowing way :

use std::collections::VecDeque;
use lfsr_fibo::Lfsr;

fn main() {
	let mut lfsr = Lfsr::new(vec![11, 6, 3]);
	lfsr.set_key(VecDeque::from([1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0]));

	let mut generated: Vec<u8> = vec![];

	for _i in 0..256 {
		generated.push(lfsr.clock());
	}
	println!("Generated : {:?}", generated);
}