The hashing function takes the x and y cell coordinates and scrambles them together into a single number. The idea is to make a function that cells that are near each other in the grid won't be near each other in the hash table. I do this by multiplying the x and y coordinates by two different large prime numbers and then XORing the result. It works quite well.

Spatial hashes are a bit more complicated though if you are dealing with objects that overlap more than one cell at a time. For just a list of vertexes that are effectively sizeless you don't really run into those issues though.

No no. I think you misunderstood. The hash function generates an index for a cell based on cell_x and cell_y, so that you can use a small 1D array to represent all cells everywhere instead of using a 2D or 3D array.

You don't store vertexes in that 1D array (or 2D or 3D array) but a list of vertexes.

That code makes an array of 10 lists. The first list has two numbers in it, and the rest are empty. You might want to spend some time looking at basic data structures such as linked lists and such if this is proving tricky for you.