refined code gen hash to reduce probability of collision.