Debian Codegraph @

debian/rust-vendor/num-prime/README.md

raw
1 # num-prime
2
3 [![Crates.io](https://img.shields.io/crates/v/num-prime.svg)](https://crates.io/crates/num-prime)
4 [![CodSpeed](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/uutils/num-prime?utm_source=badge)
5 [![Discord](https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat)](https://discord.gg/wQVJbvJ)
6 [![License](http://img.shields.io/badge/license-Apache%202-blue.svg)](https://github.com/uutils/num-prime/blob/main/LICENSE)
7 [![dependency status](https://deps.rs/repo/github/uutils/num-prime/status.svg)](https://deps.rs/repo/github/uutils/num-prime)
8
9 [![CodeCov](https://codecov.io/gh/uutils/num-prime/branch/main/graph/badge.svg)](https://codecov.io/gh/uutils/num-prime)
10
11 This crate provides utilities for prime number related functionalities:
12
13 - Primality testing
14 - Deterministic primality check of `u64` integers (using a very fast hashing algorithm)
15 - Fermat probable prime test
16 - Miller-rabin probable prime test
17 - (strong/extra strong) Lucas probable prime test
18 - Baillie-PSW test
19 - Sophie Germain safe prime test
20 - Primes generation and indexing
21 - A naive implementation of the sieve of Eratosthenes
22 - Unified API to support other prime generation backends
23 - Generate random (safe) primes
24 - Find previous/next prime
25 - Integer factorization
26 - Trial division
27 - Pollard's rho algorithm
28 - Shanks's square forms factorization (SQUFOF)
29 - Fast factorization of `u64` and `u128` integers
30 - Number theoretic functions
31 - Prime Pi function (number of primes under limit), its estimation and its bounds
32 - Nth prime, its estimation and its bounds
33 - Moebius function
34 - Divisor Sigma function *([in examples](./examples/divisor_sigma.rs))*
35 - Prime Omega function *([in examples](./examples/prime_omega.rs))*
36
37 It's based on the `num` creates and most functions are decently optimized with pre-computed tables (see **[benchmark results here](./PERFORMANCE.md)**).