Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabiospampinato/crypto-random-prime
Generate a cryptographically-random probable prime number that passes the Miller-Rabin test with the given number of bits of entropy.
https://github.com/fabiospampinato/crypto-random-prime
generator number prime random
Last synced: 2 months ago
JSON representation
Generate a cryptographically-random probable prime number that passes the Miller-Rabin test with the given number of bits of entropy.
- Host: GitHub
- URL: https://github.com/fabiospampinato/crypto-random-prime
- Owner: fabiospampinato
- License: mit
- Created: 2023-08-05T18:43:48.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-24T16:28:48.000Z (over 1 year ago)
- Last Synced: 2024-11-19T22:53:28.925Z (2 months ago)
- Topics: generator, number, prime, random
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Crypto Random Prime
Generate a cryptographically-random probable prime number that passes the Miller-Rabin test with the given number of bits of entropy.
## Install
```sh
npm install --save crypto-random-prime
```## Usage
```ts
import random from 'crypto-random-prime';// Generate a 300-bits random prime, performing 64 rounds of Miller-Rabin tests
random ( 300, 64 ); // => 1229897812185405005544550995303702949862219513844036076668441860571526838822977324092558451n
```## License
MIT © Fabio Spampinato