polachok/py-phash — pull request #5 by lifthrasiir (2012-10-19 04:26:57+00:00)
Title: Make pHash.hamming_distance available for non-long arguments

Current implementation breaks CPython when the function is used with non-long arguments; at least there should be `PyLong_Check`, but it would be better to convert arguments to long long int whenever possible as hamming distance is slow in pure Python. This commit implements it.