当前位置:网站首页>Interface automation -md5 password encryption

Interface automation -md5 password encryption

2022-06-25 20:12:00 chinrock

# quote hashlib, Belong to python Self contained , No installation required 
import hashlib
'''  Package acquisition MD5 Methods  '''
class MD5:
    def get_md5(self,psw):
        # Instantiation md5 object , And then call update Method 
        md5=hashlib.md5()
        # Call the encryption method to encrypt directly 
        md5.update(psw.encode("utf-8"))
        # return md5 password 
        return md5.hexdigest()
    # hash.digest()
    #  Back to summary , As a binary data string value 
    # 
    # hash.hexdigest()
    #  Back to summary , As a hexadecimal data string value 

Encrypted password
 Insert picture description here

hash.digest()

Back to summary , As a binary data string value

hash.hexdigest()

Back to summary , As a hexadecimal data string value

原网站

版权声明
本文为[chinrock]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202190506319707.html