hashlib

  • import hashlib
    obj = hashlib .md5("sadsa".encode("utf8"))
    
    obj .update("hello".encode("utf8") )
    
    print(obj.hexdigest())       #5d41402abc4b2a76b9719d911017c592
    import hashlib
    obj = hashlib .md5()  #55a2d393484a551c1cb9d94c92f5de89
    
    obj .update("sadsa".encode("utf8") )                # =obj .update("sadsaroot".encode("utf8") 
    
    
    
    
    print(obj.hexdigest()) 
    obj .update(
    "root".encode("utf8") )

    print(obj.hexdigest()) #还有SHA256,SH384,SH512算法等

     

posted on 2018-02-25 22:26  python_an  阅读(92)  评论(0编辑  收藏  举报

导航