OleksandrDanylchenko / nodejs-prho

Pollard's rho algorithm implemented in Node.js with long arithmetics

Home Page:https://npmjs.com/package/nodejs-prho

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nodejs-prho

Pollard's rho algorithm implemented in Node.js

Documentation

Wiki - https://en.wikipedia.org/wiki/Pollard%27s_rho_algorithm

Inspiration

Codepen - https://codepen.io/michaelsknobloch/pen/Kzqeyb

Reasoning

Solved infinite loops, which can happen on some numbers in https://www.npmjs.com/package/prho package, with recursive approach from https://codepen.io/michaelsknobloch/pen/Kzqeyb and usage of different functions to find factors to prevent stucking. Also it support long arithmetics with native BigInt JS object.

Installation

$ npm install nodejs-prho
$ yarn add nodejs-prho

Usage

const prho = require('nodejs-prho')
const factors = prho(420n)
// => [2 , 2 , 3 , 5 , 7]

About

Pollard's rho algorithm implemented in Node.js with long arithmetics

https://npmjs.com/package/nodejs-prho

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%