Use hash_file('sha1', $foo) instead of sha1_file().
Matches the code in composer/composer which is used to verify the checksum.
Merge pull request #73 from till/bugfix/sha1-is-incorrect

Use hash_file('sha1', $foo) instead of sha1_file().