Created
June 8, 2017 19:55
-
-
Save fritz0705/0deaeb990d40deed8db26ab1d6ff12da to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python3 | |
import sys | |
zk_code = sys.argv[-1].rjust(20, "0") | |
print("ZK Code: {}".format(zk_code)) | |
result = "" | |
# Iterate though bytes | |
for i in range(0, 20, 4): | |
nibble1 = bin(int(zk_code[i:i+2]))[2:].rjust(4, "0") | |
nibble2 = bin(int(zk_code[i+2:i+4]))[2:].rjust(4, "0") | |
result += hex(int((nibble1 + nibble2)[::-1], 2))[2:].rjust(2, "0") | |
print("Hex10 Code: {}".format(result)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment