That's more or less how it works; real-world implementations have to deal with hash collisions as well as selecting an efficient hashing method. Previously, a historic paper authored by computer ...