La tua idea è nota come Hashing e qualcuno ci ha pensato qualche anno fa