On Fri, Jan 6, 2012 at 8:42 AM, Laruence <larue...@php.net> wrote: > Hi: > so here is the problem, the number index collision can be fixed by > this idea (increase table size with a random delta). > > now we need add the random number into DJB hash, and I am not good at math, > > so Calling for help, and the random number will be stored in a > process global variable like: PHPAPI int zend_hash_random_number. > > and the reason for use a process global variable are: > 1. this would break the zend hash cache > 2. no abi backward break ( zend_hash_func) > 3. simplify ZTS protection..
A problem with a process global variable arises when the PHP process is kept alive between requests (e.g. fcgi). In that case the random value will stay the same between all requests and could be brute-forced. Not sure whether this is an issue in reality (e.g. what is the range of the random number?) Nikita -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php