Two level hashing with orientation