How to use hashilb module
This article will explain in detail how to use the hashilb module. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Import hashlib
#
M=hashlib.md5 ()
M.update (b "hello")
Print (m.hexdigest ()) # hash in hexadecimal format
Print (m.digest ()) # hash in binary format
M.update (b "It's me") # hello+it's me
Print (m.hexdigest ())
M.update (b "go to the school")
Print (m.hexdigest ())
M2=hashlib.md5 ()
M2.update ("helloIt's me King cover Tiger" .encode (encoding= "UTF-8")) # encode byte mode (bytes)
Print (m2.hexdigest ())
S2=hashlib.sha1 ()
S2.update (b "helloIt's me")
Print (s2.hexdigest ())
Import hmac
H=hmac.new (b "12345", "you are 250King" .encode (encoding= "UTF-8"))
Print (h.digest ()) # does not support Chinese (requires encode)
Print (h.hexdigest ()) # does not support Chinese
This is the end of the article on "how to use the hashilb module". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.