Precompute hash with simpler function