primercrate.rs
v0.3.0 · live on crates.io

Rust crate · CLI + library · zero dependencies

Built to live in cache.

Primer is now the published primer-sieve crate. It is a cache-aware, bit-packed segmented Sieve of Eratosthenes with a fixed 32 KiB segment, a conventional Rust library API, and a ready-to-run CLI.

Library

A small, direct Rust API.

The package is named primer-sieve; Rust imports its library as primer. Generate every prime up to an inclusive u64 limit.

// Cargo.toml
primer-sieve = "0.3.0"

// src/main.rs
use primer::sieve_primes;

let primes = sieve_primes(30);
assert_eq!(primes.len(), 10);

Release

Finished, packaged, and documented.

Version 0.3.0 is distributed through Rust's official package registry, backed by its tagged GitHub release and generated documentation on docs.rs.

  • 0.3.0Current release
  • Rust 1.70+Minimum toolchain
  • Library + CLITwo ways to use it
  • u64 limitsInclusive enumeration