JSPM

crypto-random-prime

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2708
  • Score
    100M100P100Q125970F
  • License MIT

Generate a cryptographically-random probable prime number that passes the Miller-Rabin test with the given number of bits of entropy.

Package Exports

  • crypto-random-prime

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

npm install crypto-random-prime

Usage

import random from 'crypto-random-prime';

// Let's generate a 300-bits random prime, performing 64 rounds of Miller-Rabin tests

random ( 300, 64 ); // => 1229897812185405005544550995303702949862219513844036076668441860571526838822977324092558451n

License

MIT © Fabio Spampinato