implements  hash