Looking at the Extraction of Massive Datasets book , section 1.3.2 provides an overview of hash functions. Without a computer science background, this is completely new to me; Ruby was my first language where hashit seems equivalent Dictionary<object, object>. And I never looked at how this type of data structure is.
The book mentions hash functions as a means of implementing these dictionary data structures. This item:
First, the hash function h takes the value of the hash key as an argument and produces the result is the number of buckets. The bucket number is an integer, usually in the range 0 to B - 1, where B is the number of buckets. Hash keys can be of any type. There is an intuitive property of hash functions that they “randomize”, hash keys
What are buckets in terms of hash function? It seems that the buckets are structures array-like, but hash functionis it some kind of algorithm / array-like-structurethat produces the same bucket number each time? What is inside this metaphorical bucket?
I always read that javascript objects / ruby / etc hash codes do not guarantee order. In practice, I found that the order of the keys does not change (in fact, I think using an older version of the Mozilla Rhino interpreter, which changed the code of the JS object, but I cannot be sure ...).
Does this mean that hashes (Ruby) / objects (JS) are NOT allowed by these hash functions?
Does the word use hashingdifferent meanings depending on the level at which you work with computers? i.e., it would seem that the Ruby hash symbol does not match the C ++ hash ...
source
share