A length check would catch the log file case. But really, just hash the whole file.<p>As an optimization, you might want to check for files with holes in them (&quot;sparse&quot; files). Not sure how to do that, though.