import hashlib
obj = hashlib.md5()      #还有sha1,sha224,sha256,sha384,sha512
obj.update("hello".encode('utf8'))
print(obj.hexdigest())    #5d41402abc4b2a76b9719d911017c592  长度固定,唯一对应
obj.update("root".encode('utf8'))
print(obj.hexdigest())   #e206121dbbe984f3bc6c6448846ed8cd   基于hello基础上,相当于给helloroot加密