<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: [LCP]String comparison.</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>> strcmp(), but that's no fun. Another technique I can across </FONT>
<BR><FONT SIZE=2>> was generating a modulus for the string being searched for and </FONT>
<BR><FONT SIZE=2>> looking for lines in the second file with the same modulus value</FONT>
<BR><FONT SIZE=2>> and only comparing those lines for an exact match.</FONT>
</P>
<P><FONT SIZE=2>I'm not sure looking at the code, but I think you're trying to</FONT>
<BR><FONT SIZE=2>assign a "handle" to a string, then compare the handles, right ?</FONT>
<BR><FONT SIZE=2>Good algorithms to create these is MD5, various CRC algorithms</FONT>
<BR><FONT SIZE=2>(eg the adler32 sum from libz), etc. Any hash should do.</FONT>
<BR><FONT SIZE=2>Basically, the trick is to get an algorithm which is as sensitive</FONT>
<BR><FONT SIZE=2>as possible to the input data, so that two almost identical lines</FONT>
<BR><FONT SIZE=2>generate different hashes. You thus get very unlikely false</FONT>
<BR><FONT SIZE=2>positives (but they are still a possibility).</FONT>
</P>
<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Vincent Penquerc'h </FONT>
</P>
</BODY>
</HTML>