Last active
March 4, 2020 09:18
-
-
Save centum/8ef123a38cc4cb310aa9c17dcd1acd7e to your computer and use it in GitHub Desktop.
Make sign data by MD5
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
from hashlib import md5 | |
def sign(status, addr, value, txid, apiKey): | |
return md5("{}{}{}{}{}".format(status, addr, value, txid, apiKey)).hexdigest() | |
if __name__ == "__main__": | |
print(sign( | |
2, | |
"1C3FrYaGgUJ8R21jJcwzryQQUFCWFpwcrL", | |
10000, | |
"4cb30849ffcaf61c0e97e8351cca2a32722ceb6ad5f34e630b4acb7c6dc1e73b", | |
"secret1" | |
)) | |
# expect result: 32f5bcfb3ac199a70254ff5bb339f6a7 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/api/callback_url?status=2&addr=1C3FrYaGgUJ8R21jJcwzryQQUFCWFpwcrL&value=10000&txid=4cb3 0849ffcaf61c0e97e8351cca2a32722ceb6ad5f34e630b4acb7c6dc1e73b&sign=32f5bcfb3ac199a70254ff5bb339f6a7