Created
March 26, 2018 18:07
-
-
Save yarjor/b9c0a1c8184a1b549bc833d356925a49 to your computer and use it in GitHub Desktop.
[Calculate Hamming] #datascience #crypto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calc_hamming(st1, st2): | |
| return sum([i != j for i, j in zip(bitstring(st1), bitstring(st2))]) | |
| # BitString can be found in another gist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment