Hi,

I need to code up a system that I need to compare to my own. In this system they use two types of hash function.

The first hash function takes an IP address and hashes it to give x,y co-ordinates randomly anywhere within a boundary square (I know the x,y coordinates of the corners of the boundary square).

The next function divides the boundary square into a grid of smaller squares (that I have coded up) but then takes an ip address and again hashes it to get x,y co-ordinates but this time the x,y coordinates must be randomly chosen from the centres of the squares in the grid i.e. it randomly chooses the central coordinates of one of the grid squares.

Can someone please advise as to how I will go about writing this hash function?
I'm not looking for specific syntax more the approach.

Thanks in advance.