[About whether md5 is enough] 50 thousand data, MD5 began to appear again! Doubt

Source: Internet
Author: User
[About whether md5 is enough] 50 thousand data, MD5 began to appear again! If you are confused about the database table pre_post, The Field id is automatically incremented and the primary key is used. The md5 field is unique. The initial field md5 value is & nbsp; $ md5 = md5 (time (). $ ip); later changed to only & nbsp; $ md5 = md5 (& nbsp; time () & nbsp ;); then, each time thousands of write operations are performed, 50 thousand data will be output [about whether md5 is enough]. MD5 begins to repeat! Doubt
Database table pre_post, Field id auto increment, primary key. The md5 field is unique.

The initial field md5 value is $ md5 = md5 (time (). $ ip );
Later it was changed to only $ md5 = md5 (time (); then, md5 duplication occurs every time thousands of writes, #1062:

#1062-Duplicate entry 'dbecd780b5f02c35f236ac0f4766c634 'for key 'md5'



// Original md5 generation, $ ip is the client IP address of the visitor
$ Md5 = md5 (time (). $ ip );

// The current md5 generation is based only on the current timestamp
$ Md5 = md5 (time ());


One question: the first time Segment encryption is from time (). $ ip, and the second time is changed to time (). In this case, the generated md5 will not be duplicated. However, the md5 generated in the second phase is the same as the md5 generated in the first phase, and it is repeated several times every less than 1 thousand times. Confused


------ Solution --------------------
Microtime ()

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.