generate hash from file contents