| Crates.io | lfsr-fibo |
| lib.rs | lfsr-fibo |
| version | 0.1.0 |
| created_at | 2025-09-10 09:22:16.979992+00 |
| updated_at | 2025-09-10 09:22:16.979992+00 |
| description | Efficient pure Rust implemention of LFSR using Fibonacci representation. |
| homepage | |
| repository | https://github.com/acmo0/lfsr-fibo.git |
| max_upload_size | |
| id | 1832279 |
| size | 5,459 |
Efficient pure Rust implementation of LFSR in fibonacci representation.
Please see installation details and doc on crates.io.
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);
}