Created
July 7, 2011 12:22
-
-
Save insom/1069395 to your computer and use it in GitHub Desktop.
Consistent Password Hashing, for Developers
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/python | |
import hashlib | |
import sys | |
def main(key, username, hostname): | |
m = hashlib.md5('%s%s%s' % (key, username, hostname)) | |
h = m.hexdigest() | |
f8 = h[:8] | |
print f8 | |
if __name__ == '__main__': | |
main(*sys.argv[1:]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment