Python3 Hashlib Module (encryption)

Source: Internet
Author: User
Tags md5 encryption

MD5 Encryption algorithm?
1234567891011121314 import hashlib""" MD5加密 """hash_md5 = hashlib.md5()hash_md5.update(b"hello")#b 表示byte类型hash_md5.update(b"world")print(hash_md5.hexdigest())""" 十六进制MD5加密结果"""print(hash_md5.digest())"""  二进制MD5加密结果 """""" 分几次update的参数加密结果和拼接一起加密结果一样"""hashmd5 = hashlib.md5()hashmd5.update(b"helloworld")print(hashmd5.hexdigest())print(hashmd5.digest())
Operation Result:?
1234 fc5e038d38a57032085441e7fe7010b0  --十六进制b‘\xfc^\x03\x8d8\xa5p2\x08TA\xe7\xfep\x10\xb0‘--二进制fc5e038d38a57032085441e7fe7010b0b‘\xfc^\x03\x8d8\xa5p2\x08TA\xe7\xfep\x10\xb0‘

Python3 hashlib Module (encryption)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.