hash value computation for indices takes index dimension into account