title: How to hash a range of numbers to a single position in the hash table
body: <p>Basically I have a 2xN array of ints to ints, which indicates from which position to which position of an objects location.  Then I have a second array of ints and I want to find which ints land on which object.  So for example:</p>
  
  <p>First array</p>
  
  <p>A: 0 - 500</p>
  
  <p>B: 501 - 900</p>
  
  <p>C: 901 - 1055</p>
  
  <p>D: 1056 - 9955
  etc.</p>
  
  <p>Second array:
  1, 999, 3, 898, 55, 43, 1055, 593, 525, 3099, etc.</p>
  
  <p>This should return the A, C, A, B, A, A, C, B, B, D, etc.</p>
  
  <p>What I am trying to figure out is if there is a way to hash the first array, using some hash functions, such that when hashing the second array I will get a collision if it falls within the range of an object.  Any ideas how to do this or if its possible?</p>
  
  <p>Thanks!</p>