Implement writehash command