__author__ = "Alex Li"


import hashlib

m = hashlib.md5()
m.update(b"Hello")
print(m.hexdigest())
m.update(b"It's me")
print(m.hexdigest())
m.update(b"It's been a long time since we spoken...")

m1  = hashlib.md5()
m1.update(b"HelloIt's me")
print(m1.hexdigest())

m2 = hashlib.md5()
m2.update("HelloIt's me天王盖地虎".encode(encoding="utf-8"))
print(m2.hexdigest())

s2  = hashlib.sha1()
s2.update(b"HelloIt's me")
print(s2.hexdigest())


import hmac

h = hmac.new(b"12345","you are 250你是".encode(encoding="utf-8"))
print(h.digest())
print(h.hexdigest())

相关文章:

  • 2021-09-14
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-01-30
  • 2021-12-14
猜你喜欢
  • 2021-08-10
  • 2021-10-06
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
相关资源
相似解决方案