擅长:python、mysql、java
<p>只需将<a href="http://docs.python.org/library/string.html#string.strip" rel="nofollow">strip</a>应用于其他哈希:</p>
<pre><code>if thishash == otherhash.strip():
print "they are the same"
else:
print "they are not the same"
</code></pre>
<p>一些补充建议:</p>
<ol>
<li>不要使用无关紧要的括号。像Python一样。你知道吗</li>
<li>或许<a href="http://docs.python.org/library/string.html#string.lower" rel="nofollow">lowercasing</a>其他哈希可能是个好主意。你知道吗</li>
</ol>