code: func (idx *MemoryIndex) genOffsetHash() error {
  	count, err := idx.Count()
  	if err != nil {
  		return err
  	}
  
  	idx.offsetHash = make(map[int64]plumbing.Hash, count)
  	idx.offsetHashIsFull = true
  
  	var hash plumbing.Hash
  	i := uint32(0)
  	for firstLevel, fanoutValue := range idx.Fanout {
  		mappedFirstLevel := idx.FanoutMapping[firstLevel]
  		for secondLevel := uint32(0); i < fanoutValue; i++ {
  			copy(hash[:], idx.Names[mappedFirstLevel][secondLevel*objectIDLength:])
  			offset := int64(idx.getOffset(mappedFirstLevel, int(secondLevel)))
  			idx.offsetHash[offset] = hash
  			secondLevel++
  		}
  	}
  
  	return nil
  }
docs: // genOffsetHash generates the offset/hash mapping for reverse search.