I need a hash function for a Look Up table, so that if my values are from 0 to N, I need a hash function that give me a value from 0 to n, being n << N. Another piece
Rewire bits in random order and take lower log2(n) bits
log2(n)
Or just take lower log2(n) bits if your data is evenly distributed.