Created
May 1, 2019 13:13
-
-
Save outtoin/ea9839f5b66d615360e2f95c9ad93aad to your computer and use it in GitHub Desktop.
checksum.py
This file contains 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 checksum(msg): | |
ck_a = 0 | |
ck_b = 0 | |
for i in msg: | |
ck_a = ck_a + i | |
ck_b = ck_b + ck_a | |
ck_a = ck_a % 256 | |
ck_b = ck_b % 256 | |
return (ck_a, ck_b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment