Mon Aug 27, 2012 12:21 am
import hashlib
## For algorithms have functions
print 'SHA-224: ',hashlib.sha224("codemiles").hexdigest()
print 'SHA-256: ',hashlib.sha256("codemiles").hexdigest()
print 'MD5: ',hashlib.md5("codemiles").hexdigest()
print 'MD4: ',hashlib.md4("codemiles").hexdigest()
print 'SHA-1: ',hashlib.sha1("codemiles").hexdigest()
## For algorithms have no functions ( Creating objects)
myHashAlg = hashlib.new('ripemd160');
myHashAlg.update('codemiles')
print 'RIPEMD-160: ',myHashAlg.hexdigest()
## Checking if the character case make a different.?
if hashlib.sha1("code").hexdigest() == hashlib.sha1("CODE").hexdigest():
print "NO"
else:
print "YES"
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.