javascript-php MD5 encryption mode and JS MD5 encryption is the same

Source: Internet
Author: User
Title if not the same how to use PHP to write Javascipt MD5 encryption method

Reply content:

Title if not the same how to use PHP to write Javascipt MD5 encryption method

First of all you know what to do when MD5. You can refer to Google alive this article: http://segmentfault.com/blog/liangyi/1190000002409125

In general: MD5 is a kind of information digest algorithm, which is independent of the specific language. You can do this with Java, PHP, or JavaScript, and the value of MD5 is changed based on whether the information has changed. For the same piece of information, the values calculated in the language above should be the same. Not the same. That means they have different implementations of the algorithm.

JS where the MD5, are the third-party implementation

Then again, since they are all called MD5, the algorithm is definitely the same, but there are differences in the types of data values returned 可能会

MD5 evaluates to 128bit hash values, some Java libraries return a byte array of 16 bytes (8bit=1byte), and most of the standard MD5 implementations return the hex representation of the 16 bytes directly, which is a string of 32 16 binary numbers.

  • 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.