- Modified
setup.pyto no longer read fromREADME.mdandHISTORY.mdas it was causing errors when installing from PyPi.
pip install basehashgiving error. Corrected this insetup.py
-
Massive overhaul on the primes.py methods. Each method was benchmarked to get the best optimization possible.
-
Uses gmpy2 if available, otherwise use the baillie_psw primality check and the next_prime methods in primes.py
-
base.hash()no longer accepts argumentlength. One instance per hash length. -
base.maximum(),base.maximum_value(), andbase.prime()have been removed. To get maximum hash value, callbase.maximum. To get the prime used callbase.prime -
primes.miller_rabinwas removed as it was replaced byprimes.baillie_pswin v1.0.2.
- Implemented six to allow use of
xrangein Python 2 andrangein Python 3
- Fixed ussues with python 3.4
-
Create custom random alphabets using
basehash.generate_alphabet(alphabet). -
BaseHash.base now checks
alphabetfor duplicates usingset.
- base and baseN now accept a length parameter, defaulted to HASH_LENGTH so that baseN.hash(num, length) is set globally, not locally.
- Moved everything to an object. Removed baseN.py files, allows for easier
configuration of
GENERATORand for extending to a custom alphabet.
-
There was an issue with hashes sometimes being returned one to two charcters shorter than
length, causingbase.base_unhashto not function properly. To fix this, the hashes are right-padded withalphabet[0]. -
Since
0raises an error insideprimes.invmul,base.base_unhashis unable to unhash it. To allow the start of your number sequence to be0instead of1, if needed, hashingbase.base_hash(0, length=6)will return''.rjust(length, alphabet[0]).
- Fixed issues with setup.py. First time using a setup.py within a package, first time publishing the library outside of GitHub.
- Added nose unittests.
- Added setup.py, LICENSE, HISTORY.rst, and .travis.yaml.
-
Added a simple test for
prime < 31to reduce calculation time. -
Fixed issue of
strong_pseudoprime(n, 3)giving false results.
-
Changed primality test from Miller-Rabin to Baillie-PSW. This algorithm is significantly faster.
-
Changed determination to use
sqrt(n)orisqrt(n)to an improved version ofisqrt(n). -
BaseHash is now PEP compliant.
- Changed primality test from Fermat to Miller-Rabin. Improved accuracy on false results when it comes to pseudoprimes.
- Released code to GitHub repository python-basehash https://github.com/bnlucas/python-basehash
- Initialization