Pollard's rho algorithm implemented in Node.js
Wiki - https://en.wikipedia.org/wiki/Pollard%27s_rho_algorithm
Codepen - https://codepen.io/michaelsknobloch/pen/Kzqeyb
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.
$ npm install nodejs-prho
$ yarn add nodejs-prho
const prho = require('nodejs-prho')
const factors = prho(420n)
// => [2 , 2 , 3 , 5 , 7]