Created
August 15, 2014 09:01
-
-
Save SEJeff/d5fee36d8dd6b015a2ee to your computer and use it in GitHub Desktop.
Hexdigest on python 2.6 and 2.7
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
############################################################################################ | |
>>> sys.version | |
'2.7.3 (default, Aug 9 2012, 17:23:57) \n[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)]' | |
>>> for algo in hashlib.algorithms: | |
... print '{algo} has hexdigest()'.format(instance=getattr(hashlib, algo)(), algo=algo) | |
... | |
md5 has hexdigest() | |
sha1 has hexdigest() | |
sha224 has hexdigest() | |
sha256 has hexdigest() | |
sha384 has hexdigest() | |
sha512 has hexdigest() | |
############################################################################################ | |
>>> sys.version | |
'2.6.5 (r265:79063, Oct 1 2012, 22:04:36) \n[GCC 4.4.3]' | |
>>> for algo in ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'): | |
... print '{algo} has hexdigest()'.format(instance=getattr(hashlib, algo)(), algo=algo) | |
... | |
md5 has hexdigest() | |
sha1 has hexdigest() | |
sha224 has hexdigest() | |
sha256 has hexdigest() | |
sha384 has hexdigest() | |
sha512 has hexdigest() | |
############################################################################################ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment