RE: [PHP4BETA] Zend hash functions enchantments [PATCH]
| From: | August Zajonc | Date: | Thu, 06 Apr 2000 07:46:00 +0000 |
| Subject: | RE: [PHP4BETA] Zend hash functions enchantments [PATCH] | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13211@lists.php.net to get a copy of this message | ||
Consider the case of a hash value which has 10 digits (numbers). Now you
have a string which only takes numbers, which is eleven charchters long.
There are more possible values then hash values. Where do the extra values
go? Duplicate hash values.
The whole point of a hash is to create a much shorter representation of
complex data. It is likely then that the total range of the hash is less
then the range of the data. Duplicate hash values are virtually certain...
AZ
> -----Original Message-----
> From: Jerry Lundström [mailto:jerry.lundstrom@citat.se]
> Sent: Thursday, April 06, 2000 12:33 AM
> To: Andi Gutmans
> Cc: php4beta@lists.php.net
> Subject: Re: [PHP4BETA] Zend hash functions enchantments [PATCH]
>
>
> On Wed, 5 Apr 2000 18:01:19 +0200 (IST), Andi Gutmans
> <andi@zend.com> wrote:
>
> >I don't think your patch is correct unless I'm missing something.
> >Two different strings can have the same length and the same hash
> value. It
> >doesn't seem as if your implementation works in this case.
>
> Are you sure about this?
> If it is so then then hash algo seams a little bit weak because
> that should
> not happen. You shouldn't get two diffrent strings with the same
> hash value.
>
> Guess I have to move back to strings then...
>
> --
> Jerry Lundström:<jerry.lundstrom@citat.se>
> mobile+46.739.876053:phone+46.31.7107244:fax+46.31.7107201
> citat.solutions:Kronhusgatan.9:SE-411.05.Göteborg:Sweden
> www.citat.se/solutions
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net
>