nim-lang / bigints

BigInts for Nim
MIT License
123 stars 32 forks source link

feat: add Pollard's p-1 example #138

Closed vil02 closed 9 months ago

vil02 commented 11 months ago

This PR adds an example of factorization using Pollard's p-1 algorithm. This is related to #70 and similar to #129.

konsumlamm commented 9 months ago

Given that we already have an example for Pollard's rho algorithm, which looks pretty similar, and that Pollard's p-1 algorithm only works for certain numbers, I'm not sure we should add this.

vil02 commented 9 months ago

Both of these algorithms work for some class of the numbers. I am not sure what is the relation between these classes - @konsumlamm do you know?

Eventually these are two different algorithms. I think it will not hurt to have both as examples.

dlesnoff commented 9 months ago

I am okay with adding this example. It adds a little burden maintaining those examples, especially when the API is not perfectly stable, or the Nim version changes. Let's close #70 after this PR and focus on the library.