Get a hash of a file or a stream