-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
numpy.int32? #4
Comments
hello,rmrmg; |
I got the same error: |
Still getting the same issue. Failing unit tests on my machine (Windows 10, python 3.7), looks like the hash values returned by
which fixed the error, but it still fails unit tests so is clearly getting different encoding to what they originally got, thus making it pretty unreliable. I tried using the encodings for ML and got terrible results, so hard to tell if this is due to encoding or the description not being suitable for my system. |
hash function in drfp/fingerprint.py we have:
hash_values.append(int(blake2b(t, digest_size=4).hexdigest(), 16))
which produce values in range [0, 4G], then based on the list numpy array is created:
np.array(hash_values, dtype=np.int32)
but np.int32 has range [-2G,2G]
On linux it is automatically wrapped into [-2G,2G] range but on windows it failed with overflow error.
Is [-2G,2G] range correct and expected id est can I change the first line into:
hash_values.append(int(blake2b(t, digest_size=4).hexdigest(), 16) - 2_147_483_647 )
or should I change range in array to uint32:
np.array(hash_values, dtype=np.uint32)
Which of above should I do?
The text was updated successfully, but these errors were encountered: