# Hash Function change between PHP4 and PHP5

- Thread: https://externals.io/message/20198
- Original archive: https://news-web.php.net/php.internals/20198
- Started by Stefan Esser on 2005-11-20T15:37:17+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #20198 — Stefan Esser — 2005-11-20T15:37:17+00:00

URL: https://externals.io/message/20198#20198

Hello,

I just realised, that between PHP4 and PHP5 we changed the hash function
used within zend_hash.h from DJBX33X to DJBX33A. The diff is here =>
http://cvs.php.net/diff.php/ZendEngine2/zend_hash.h?ws=0&r1=1.57&r2=1.58&ty=u

Does anyone remember the exact reason for that? Or was the change done
by accident when the loops were unrolled? I have no idea if there is a
big difference for our hashing needs, but I am just curious if we
changed it because of benchmarks...

Stefan Esser

-- 
--------------------------------------------------------------------------
 Stefan Esser                                               sesser@php.net
 Hardened-PHP Project                         http://www.hardened-php.net/

 GPG-Key                gpg --keyserver pgp.mit.edu --recv-key 0x15ABDA78
 Key fingerprint       7806 58C8 CFA8 CE4A 1C2C  57DD 4AE1 795E 15AB DA78

---

## #20204 — Marcus Boerger — 2005-11-20T20:38:25+00:00

URL: https://externals.io/message/20198#20204 · In reply to: #20198

Hello Stefan,

  as said in private already. This pretty much looiooks like a take over
problem. And as a sidenote, loop unwinding with string algorithmns should
take care of byte alignment. Both said the code is damn wrong.

marcus

Sunday, November 20, 2005, 4:37:17 PM, you wrote:

> Hello,

> I just realised, that between PHP4 and PHP5 we changed the hash function
> used within zend_hash.h from DJBX33X to DJBX33A. The diff is here =>
> http://cvs.php.net/diff.php/ZendEngine2/zend_hash.h?ws=0&r1=1.57&r2=1.58&ty=u

> Does anyone remember the exact reason for that? Or was the change done
> by accident when the loops were unrolled? I have no idea if there is a
> big difference for our hashing needs, but I am just curious if we
> changed it because of benchmarks...

> Stefan Esser

> -- 
> --------------------------------------------------------------------------
>  Stefan Esser                                               sesser@php.net
>  Hardened-PHP Project                         http://www.hardened-php.net/

>  GPG-Key                gpg --keyserver pgp.mit.edu --recv-key 0x15ABDA78
>  Key fingerprint       7806 58C8 CFA8 CE4A 1C2C  57DD 4AE1 795E 15AB DA78
> --------------------------------------------------------------------------




Best regards,
 Marcus
