| Crates.io | primesieve_wrapper |
| lib.rs | primesieve_wrapper |
| version | 0.1.2 |
| created_at | 2025-10-22 02:53:52.691844+00 |
| updated_at | 2026-01-10 21:29:16.968354+00 |
| description | Wrapper for Primesieve C library |
| homepage | |
| repository | https://github.com/hacatu/primesieve_wrapper |
| max_upload_size | |
| id | 1894849 |
| size | 35,486 |
primesieve_wrapperprimesieve_wrapper is a Rust wrapper for Primesieve.
Currently, you must have primesieve installed on your system.
If it is not in a standard location, you may need to edit Cargo.toml to include "-Clink-arg=-L/usr/local/lib" in rustflags.
Add primesieve_wrapper to your Cargo.toml:
[dependencies]
primesieve_wrapper = "0.1.0" # Replace with the latest version from crates.io
Then, in your Rust code:
use primesieve_wrapper::generate_primes;
fn main() {
let primes = generate_primes(1_000_000_0000u64);
let primes: &[_] = primes.borrow();
let count = primes.iter().filter(|&&p|p&4==1).count();
println!("Found {count} Pythagorean primes up to 10^9");
}
primesieve_wrapper is licensed under CC0-1.0. See LICENSE for details.
Primesieve is licensed under BSD-2-Clause