Results 1 to 4 of 4

Thread: MD5-ing two identical values getting different results

  1. #1
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055

    MD5-ing two identical values getting different results

    mysql's MD5 is giving me this:

    md5(http://www.jdoqocy.com/click-1198878-10609240)=8327782fbf64b45a2bdc1740cebdca72
    md5(http://www.jdoqocy.com/click-1198878-10609240)=8327782fbf64b45a2bdc1740cebdca

    I'm at a loss. Should I do the MD5 in PHP instead of mysql?
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  2. #2
    Site Contributor KLB's Avatar
    Join Date
    Feb 2006
    Location
    Saco Maine
    Posts
    1,181
    Quote Originally Posted by Chris View Post
    mysql's MD5 is giving me this:

    md5(http://www.jdoqocy.com/click-1198878...dc1740cebdca72
    md5(http://www.jdoqocy.com/click-1198878...2bdc1740cebdca

    I'm at a loss. Should I do the MD5 in PHP instead of mysql?
    Could it just be a truncating of the returned value in the second instance? I ran your MD5 string through MySQL and kept getting the first value.
    Ken Barbalace - EnvironmentalChemistry.com (Environmental Careers, Blog)
    InternetSAR.org: Volunteers Assisting Search and Rescue via the Internet
    My Firefox Theme Classic Compact: Based onFirefox's classic theme but uses much less window space

  3. #3
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    There is no truncating in either instance, anywhere in the code.

    The point was to make sure I only add the link to the database once, but it was being added multiple times because of the md5 strings being slightly different. So why would MySQL take it upon itself (or php for that matter) to truncate it without me telling it to?
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  4. #4
    Site Contributor KLB's Avatar
    Join Date
    Feb 2006
    Location
    Saco Maine
    Posts
    1,181
    Quote Originally Posted by Chris View Post
    There is no truncating in either instance, anywhere in the code.

    The point was to make sure I only add the link to the database once, but it was being added multiple times because of the md5 strings being slightly different. So why would MySQL take it upon itself (or php for that matter) to truncate it without me telling it to?
    What were the differences between the two instances of running the MD5 function? Was it on the same MySQL server?

    The length of an MD5 hash is supposed to be 32 characters long. If it is shorter than this then something went wrong.
    Ken Barbalace - EnvironmentalChemistry.com (Environmental Careers, Blog)
    InternetSAR.org: Volunteers Assisting Search and Rescue via the Internet
    My Firefox Theme Classic Compact: Based onFirefox's classic theme but uses much less window space

Similar Threads

  1. Strange Google Results
    By Mike in forum Search Engine Optimization
    Replies: 9
    Last Post: 07-29-2009, 01:23 AM
  2. Form results to formatted PDF format
    By CreationNation in forum Website Programming & Databases
    Replies: 1
    Last Post: 04-07-2006, 01:37 PM
  3. Google Results
    By cameron in forum Search Engine Optimization
    Replies: 16
    Last Post: 08-12-2004, 04:06 AM
  4. Local Rank stuff...
    By chromate in forum Search Engine Optimization
    Replies: 41
    Last Post: 02-07-2004, 03:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •