diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-28 09:36:40 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-28 09:36:40 +0000 |
commit | ab19240082dfba31ce2fd03e2c5d9e7779bcdc76 (patch) | |
tree | a3b8745e8178bdd504a7211ff36303b26b7367de /pod/perlguts.pod | |
parent | 31d7d75aac642a364f35c283bcf351a66fe2c5ed (diff) | |
download | perl-ab19240082dfba31ce2fd03e2c5d9e7779bcdc76.tar.gz |
document changed PERL_HASH()
p4raw-id: //depot/perl@2333
Diffstat (limited to 'pod/perlguts.pod')
-rw-r--r-- | pod/perlguts.pod | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pod/perlguts.pod b/pod/perlguts.pod index 7ccb80e15a..b835b59a38 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -350,11 +350,13 @@ This returns NULL if the variable does not exist. The hash algorithm is defined in the C<PERL_HASH(hash, key, klen)> macro: - i = klen; hash = 0; - s = key; - while (i--) - hash = hash * 33 + *s++; + while (klen--) + hash = (hash * 33) + *key++; + hash = hash + (hash >> 5); /* after 5.006 */ + +The last step was added in version 5.006 to improve distribution of +lower bits in the resulting hash value. See L<Understanding the Magic of Tied Hashes and Arrays> for more information on how to use the hash access functions on tied hashes. |