Socket
Socket
Sign inDemoInstall

pollardsrho

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pollardsrho

integer factorization using Pollard's rho algorithm with Brent cycle detection, Miller–Rabin primality test


Version published
Maintainers
1
Install size
29.5 kB
Created

Readme

Source
  1. Integer factorization using Pollard's rho algorithm with Brent cycle detection

Usage:

import PollardsRho64 from './PollardsRho64.js';

console.log(PollardsRho64(2n**64n - 585n, 2**20)); // 9094863431n


import PollardsRho from './PollardsRho.js';

console.log(PollardsRho(2n**64n - 585n, 2**20)); // 9094863431n

PollardsRho64 is only for 64 bit unsigned integers. Do not call for prime numbers. It is very slow for them. The second argument is maximum number of steps, you can use 2**20.

  1. Prime testing using Miller-Rabin algorithm:

Usage:

import isPrime64 from './isPrime64.js';

console.log(isPrime64(2n**64n - 585n) === 0); // false


import isPrime from './isPrime.js';

console.log(isPrime(2n**64n - 585n)); // false

Keywords

FAQs

Last updated on 04 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc