a bit cleaner way to calculate a file sha1