擅长:python、mysql、java
<blockquote>
<p>does it make any diff. if I hash '128.0.0.5' or its binary '0001110101010..' whatever that is or without the '.'s</p>
</blockquote>
<p>不是真的。在</p>
<blockquote>
<p>zlib.crc32 returns a signed integer. Does modding (%) a neg. with a positive H always give a pos no?</p>
</blockquote>
<p>是的。在</p>
<blockquote>
<p>Does %-ing by H affect how good the hash function is? ( I mean is that the best I could do for the available space, with the available xlib.crc32)</p>
</blockquote>
<p>你最好使用校验和的所有位来弥补它们缺乏“雪崩效应”。如<code>192.168.1.1</code>、<code>192.168.1.2</code>等的单个数字变体可能只在校验和的前几位产生差异,而且由于<code>%</code>只关心最后一位,哈希将发生冲突。在</p>