Please explain map implementation in go

When a map operation is performed, such as ("colors[“Black”] = "#000000), a hash key is generated against the key that is specified. In this case the string “Black” is used to generate the hash key. The low order bits (LOB) of the generated hash key is used to select a bucket.
Once a bucket is selected, the key/value pair needs to be stored, removed or looked up, depending on the type of operation. If we look inside any bucket, we will find two data structures. First, there is an array with the top 8 high order bits (HOB) from the same hash key that was used to select the bucket. This array distinguishes each individual key/value pair stored in the respective bucket. Second, there is an array of bytes that store the key/value pairs. The byte array packs all the keys and then all the values together for the respective bucket.

what does low order bit and high order bit mean, I do not understand also this part(First, there is an array with the top 8 high order bits (HOB) from the same hash key that was used to select the bucket. ) From the same hash key?? Does it mean that original hash from KEY (black) splited into 8 peaces?

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.