Created
June 5, 2014 09:26
-
-
Save lwzm/9326c8726d532e328988 to your computer and use it in GitHub Desktop.
command `md5sum` in Python
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
| import hashlib | |
| def md5sum(t): | |
| return hashlib.md5(t).hexdigest() | |
| if __name__ == "__main__": | |
| print(md5sum(b'')) # same as "$ md5sum /dev/null" in shell | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment