Base64 SHA1 MD5

Source: Internet
Author: User
Tags base64 md5 printable characters sha1 sha1 hash sha1 hash algorithm
Base64 Code

1:base64 is one of the most common encoding methods for transmitting 8Bit bytecode on the network, Base64 is a method of representing binary data based on 64 printable characters
2:BASE64 encoding is a process from binary to character that can be used to pass longer identity information in an HTTP environment
3: The encoded data is a string containing the characters: A-Z, A-Z, 0-9, +,/
A total of 64 characters: 26 + 26 + 10 + 1 + 1 = 64. is actually 65 characters, "=" is the padding character
4:64 characters need 6 bits to represent the value of 0~63

Base64 Coding Process

1: The string "Xue" becomes "WHVL" after Base64 encoding. The number of data bits with a length of 3 bytes is 8*3=24 and can be accurately divided into 6*4

2: If the number of bytes in the data is not a multiple of 3, then the number of digits is not a multiple of 6, then the need cannot be accurately divided into 6-bit blocks. At this point, you need to add 1 or 2 0-value bytes after the original data, so that the number of bytes is multiples of 3. Then, after the encoded string, add 1 or 2 equal sign "=" to indicate the number of 0 value bytes added. Cases:
The string "Xu" becomes "whu=" after Base64 encoding.

MD5/SHA1 Hash Algorithm

1:MD5 algorithm:
1> compressibility: Any length of data, the calculated MD5 value of the length are fixed.
2> easy to calculate: It is easy to calculate the MD5 value from the original data.
3>: Any changes to the original data, even if only modify 1 bytes, the resulting MD5 values are very different.
4> Strong anti-collision: Given the original data and its MD5 value, it is very difficult to find a data with the same MD5 value (that is, to falsify data).
2:SHA1 algorithm
and MD5 similar treatment;
3: Encrypt user password, server store user password is MD5 value;
4: Compare files whether there are changes, according to the contents of the file to generate MD5 value; Base64 Code

Base64 decoding

MD5

Online Calibration Tool

SHA1

Code

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.