Am 30.09.2013 20:16, schrieb Antoine Pitrou: > On Mon, 30 Sep 2013 17:08:00 +0200 (CEST) > christian.heimes <python-checkins at python.org> wrote: >> + >> +* It should return ``0`` for zero length input. (Note: This can be handled as >> + special case, too.) > > What is this required for? The main requirement is that equal stuff > hashes equal, but there's no reason for zero-length input to hash to > zero, AFAIK. http://hg.python.org/cpython/file/d7ba4ca59023/Objects/object.c#l852 We make the hash of the empty string be 0, rather than using (prefix ^ suffix), since this slightly obfuscates the hash secret It's not a hard requirement, hence 'should' instead of 'must' like in all other cases. Christian
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4