Hello Monks! After searching, I found many nodes complaining that md5_hex producing different output from identical input. I have the opposite problem. I have different input producing identical output! I'm trying to index my websites visitor logs so I call md5_hex on a string that consists of (state,city,resolution,lang,user_agent, browser plugins) concatenated together. Some of these values are passed via javascript/hidden form elements. My thinking was that this would be diverse enough to produce "fingerprints". However, I've been getting some duplicate fingerprints with different data for example:
$string1="CA" . "Los Angeles" . "1440x900" . "en-us" . "Mozilla/4.0 (c +ompatible; MSIE 6.0; Windows NT 5.1; SV1)" . ""; $string2="CA" . "Los Angeles" . "1280x1024" . "en-us" . "Mozilla/4.0 ( +compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Medi +a Center PC 5.0; .NET CLR 3.0.04506)" . "";
Both produced '40d704470259297f93bee626c12b71fb' as output. This cgi script is running on a load balanced server and inserting records into a central database. Not using mod_perl. Does MD5 not use the whole string? Any light that you could shed would be appreciated. Oaty

In reply to md5_hex diff input produces same output? by Oaty

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.