Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

implementation of perl hashes, what type of hashing system is used

by baxy77bax (Chaplain)
on Sep 16, 2009 at 11:35 UTC ( #795573=perlquestion: print w/ replies, xml ) Need Help??
baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:

hi,

i have a bit technical question. hashing in Perl is a very practical tool, but now i'm interested to learn a bit more about it. what type of hashing stands behind the hash 'function', is it a "General Hash Function Algorithms 0.0.1" or...

where can i learn more about Perl hashing (and i don't mean how to hash some data but rather what happens when i hash a string of characters, integer... , what is the complexity of retrieving hash data and so on...).

thank you

baxy

Update: ok thank you when i study recommended references i'll come back with more questions

thank you

Comment on implementation of perl hashes, what type of hashing system is used
Re: hash function what type of hashing system is used
by almut (Canon) on Sep 16, 2009 at 12:03 UTC

    In case you want to learn more about what Perl is exactly doing when accessing hashes, the source code would be one place to start (in particular hv.c).

    If you're more interested in a general discussion, you could try Bob Jenkins' site — there are some interesting reads to be found, e.g. Hash Functions for Hash Table Lookup   (probably best to start with the latter, and then dig into the code once you have a clearer idea of what you're looking for).

Re: hash function what type of hashing system is used
by dHarry (Abbot) on Sep 16, 2009 at 12:10 UTC

    Some pointers: I found How Hashes Really Work very useful. The article also contains some interesting links like this article by Bob Jenkins (A must read IMHO). If you really want to know the gory details you can dig into the C-code (see for example hv.c).

    enjoy;)

Re: hash function what type of hashing system is used
by ikegami (Pope) on Sep 16, 2009 at 12:53 UTC

    where can i learn more about Perl hashing (and i don't mean how to hash some data [...])

    Then don't use the term "hashing". You want to learn more about the implementation of Perl hashes, not "Perl hashing". The simple answer is that they're an implementation of a hash table. More in-depth answers have already been given.

    what is the complexity of retrieving hash data

    The average complexity for fetching, inserting and deleting is O(1).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://795573]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2014-07-23 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (150 votes), past polls