<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Calculating Elf-32 in C# and .NET</title>
	<atom:link href="http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net/feed" rel="self" type="application/rss+xml" />
	<link>http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=calculating-elf-32-in-c-and-net</link>
	<description>A .NET developer in Redmond</description>
	<lastBuildDate>Fri, 23 Jul 2010 04:45:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net#comment-9753</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Mon, 20 Oct 2008 17:09:13 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net#comment-9753</guid>
		<description>All hash functions can return the same hash code for a different input sets. If they didn&#039;t they would instead be very effective compression algorithms.

[)amien</description>
		<content:encoded><![CDATA[<p>All hash functions can return the same hash code for a different input sets. If they didn&#8217;t they would instead be very effective compression algorithms.</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: QuangCanh</title>
		<link>http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net#comment-9748</link>
		<dc:creator>QuangCanh</dc:creator>
		<pubDate>Mon, 20 Oct 2008 09:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net#comment-9748</guid>
		<description>hi Damien,

Can this algorithm duplicate?

       private static uint GetELF(string str)
        {
            int i;
            uint x;
            uint result = 10;
            byte[] b = ASCIIEncoding.Unicode.GetBytes(str);
            for (i = 0; i &lt; b.Length; i++)
            {
                unchecked
                {
                    result = (result &lt;&gt; 24);
                    result &amp;= ~x;
                }
            }
            return result;
        }

hash code of &quot;mj9d&quot; and &quot;oj9f&quot; is the same.

regards,
Canh</description>
		<content:encoded><![CDATA[<p>hi Damien,</p>
<p>Can this algorithm duplicate?</p>
<p>       private static uint GetELF(string str)<br />
        {<br />
            int i;<br />
            uint x;<br />
            uint result = 10;<br />
            byte[] b = ASCIIEncoding.Unicode.GetBytes(str);<br />
            for (i = 0; i &lt; b.Length; i++)<br />
            {<br />
                unchecked<br />
                {<br />
                    result = (result &lt;&gt; 24);<br />
                    result &amp;= ~x;<br />
                }<br />
            }<br />
            return result;<br />
        }</p>
<p>hash code of &#8220;mj9d&#8221; and &#8220;oj9f&#8221; is the same.</p>
<p>regards,<br />
Canh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net#comment-5837</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Wed, 09 Jan 2008 00:30:27 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net#comment-5837</guid>
		<description>Yeah you are probably right.  I will revise it.

[)amien</description>
		<content:encoded><![CDATA[<p>Yeah you are probably right.  I will revise it.</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bitRAKE</title>
		<link>http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net#comment-5400</link>
		<dc:creator>bitRAKE</dc:creator>
		<pubDate>Tue, 04 Dec 2007 08:04:06 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/blog/2007/11/24/calculating-elf-32-in-c-and-net#comment-5400</guid>
		<description>if (work != 0) hash ^= (work &gt;&gt; 24);

Makes me wonder if it costs more to avoid this than to just do it anyway when work==0? As it has no effect on hash when work==0, and I&#039;m almost certain it&#039;ll always be slower to branch.</description>
		<content:encoded><![CDATA[<p>if (work != 0) hash ^= (work &gt;&gt; 24);</p>
<p>Makes me wonder if it costs more to avoid this than to just do it anyway when work==0? As it has no effect on hash when work==0, and I&#8217;m almost certain it&#8217;ll always be slower to branch.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
