Implement nthash