Everything in src/common has been moved to src/uucore. This is defined
as a Cargo library, instead of directly included. This gives us
flexibility to make the library an external crate in the future.
Fixes#717.
This commit builds upon @wikol's Pollard rho implementation.
It adds the following:
1. A generator for prime inverse tables. With these, we can do
very fast divisibility tests (a single multiply and comparison)
for small primes (presently, the first 1000 primes are in the
table, which means all numbers of ~26 bits or less can be
factored very quickly.
2. Always try prime inverse tables before jumping into Pollard's
rho method or using trial division.
3. Since we have eliminated all small factors by the time we're
done with the table division, only use slow trial division when
the number is big enough to cause overflow issues in Pollard's
rho, and jump out of trial division and into Pollard's rho as
soon as the number is small enough.
4. Updates the Makefile to regenerate the prime table if it's not
up-to-date.
With this change, individual submodules can specify their dependencies with
an additional file called "deps.mk" in the subdir. When building, only
the dependencies that are necessary are built, using cargo, and then linked.
This greatly simplifies adding new dependencies: add the package in
deps/Cargo.toml, and add the appropriate line in "deps.mk" in the
src/utilname/ directory, and the dependency will be built automatically
as needed.
This also removes the need to use git submodules.