Skip to content

OleksandrDanylchenko/nodejs-prho

Repository files navigation

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

Topics

Resources

License

Stars

Watchers

Forks