Python (Hashlib module)

Source: Internet
Author: User

Hashlib Module

1 ImportHashlib2 3m =hashlib.md5 ()4 5 Print(m)6 7M.update ('Hello World'. Encode ('UTF8'))8 Print(M.hexdigest ())9 TenM.update ('Nizhipeng'. Encode ('UTF8')) One Print(M.hexdigest ()) A  - #consistent results from top to bottom -M1 =hashlib.md5 () theM1.update ('Hello Worldnizhipeng'. Encode ('UTF8')) - Print(M1.hexdigest ()) -  -  +s =hashlib.sha256 () -S.update ('Hello World'. Encode ('UTF8')) + Print(S.hexdigest ())#Non-reversible

Encryption.

Execution Result:

<md5 HASH Object @ 0x7f7df3887350>  5eb63bbbe01eeed093cb22bb8f5acdc371e9ccc2a9e17eea106f63ec7bacff5a71e9ccc2a9e17eea106f63ec7bacff5ab94d27b9934d3e08a52e52d7d A7dabfac484efe37a5380ee9088f7ace2efcde9process finished with exit code 0

Python (Hashlib module)

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.