from hashlib import md5, sha512 # from _hashlib import HASH def main(): # md = md5() md = sha512() # print(type(md), md) md.update('zxl'.encode()) md.update('hhu'.encode()) result = md.hexdigest() print(type(result), result) # result=md.digest() # print(type(result), result) def main2(): # md = md5() md = sha512() md.update('zxlhhu'.encode()) result = md.hexdigest() print(type(result), result) if __name__ == '__main__': main() main2()