# crypto-miller-rabin

> Implementation of the Miller-Rabin primality test.

Latest version **1.0.1** (published 2025-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install crypto-miller-rabin
pnpm add crypto-miller-rabin
yarn add crypto-miller-rabin
bun add crypto-miller-rabin
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2025-01-14 |
| First published | 2023-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | fabiospampinato |
| Keywords | crypto, miller, rabin, prime, primality, test |

## Links

- npm: https://www.npmjs.com/package/crypto-miller-rabin
- Repository: https://github.com/fabiospampinato/crypto-miller-rabin
- Homepage: https://github.com/fabiospampinato/crypto-miller-rabin#readme
- Issues: https://github.com/fabiospampinato/crypto-miller-rabin/issues
- npm.io page: https://npm.io/package/crypto-miller-rabin

## Dependencies (2)

- [fast-mod-exp](https://npm.io/package/fast-mod-exp.md) ^1.0.1
- [crypto-random-in-range](https://npm.io/package/crypto-random-in-range.md) ^2.0.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2025-01-14
- 1.0.0 — 2023-08-05

## README

# Crypto Miller-Rabin

Implementation of the Miller-Rabin primality test.

## Install

```sh
npm install crypto-miller-rabin
```

## Usage

```ts
import isProbablyPrime from 'crypto-miller-rabin';

// Let's check if a bigint is probably prime, performing 30 rounds of Miller-Rabin tests

isProbablyPrime ( 428619803581219889005329334991561182527277683715078274359377824192296037302435017260422513n, 30 ); // => true
```

## License

MIT © Fabio Spampinato

---
_Source: https://npm.io/package/crypto-miller-rabin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
