Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # .__ .__ .__ ._____.
- # | |__ _____ _____| |__ | | |__\_ |__
- # | | \\__ \ / ___/ | \| | | || __ \
- # | Y \/ __ \_\___ \| Y \ |_| || \_\ \
- # |___| (____ /____ >___| /____/__||___ /
- # \/ \/ \/ \/ \/
- #
- # This is an example program to demonstrate the use of the hashlib library (C) 2017 Adm1n_0verride
- #
- import hashlib
- # In md5
- am = hashlib.md5()
- am.update('Greetings and merry christmas!')
- print am.hexdigest()
- # prints '2d13f4f787c5dcff600d2a2ca1862e58'
- # In SHA1
- a = hashlib.sha1()
- a.update('Example of sha1')
- print am.hexdigest()
- # prints 'd8133a2b795859d876425eb4e2331455'
- # In SHA224
- b = hashlib.sha224()
- b.update('The quick brown fox jumped over the lazy brown dog')
- print b.hexdigest()
- # prints '5f1cfd0e3d26dbc80f366eaed578aa71b0fe998d9775e45bf513d634'
- # In SHA256
- c = hashlib.sha256()
- c.update('Hello friend')
- print c.hexdigest()
- # prints 'ad7c4d7f20d11015260cd4609df255c99ebef944f59110167f2ff62a2c750072'
- # In SHA384
- d = hashlib.sha384()
- d.update('Whatever you get the picture.')
- print d.hexdigest()
- # prints '3175d35e42671528c971a0611bbe1556f27db5311940a6f62ba07ff03a84f90d200b5ac97146dacb5c58a995ba11bd5a
- # In SHA512
- asd = hashlib.sha512()
- asd.update('The day is tommrow')
- print asd.hexdigest()
- # prints 'caf1272b9a58c557001e2a1aafffc4215e3c3693352af3db9c2786d25dfe24d55d4b72e3f8dd03791fd6e0fabe0023c629dfbacb05584db553d7162acb40d1fa'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement