function hackedFileIgnoreEndingsHasher::perform_hash in Hacked! 7.2
Same name and namespace in other branches
- 6.2 includes/hacked_project.inc \hackedFileIgnoreEndingsHasher::perform_hash()
Returns a hash of the given filename.
Ignores file line endings.
Overrides hackedFileHasher::perform_hash
File
- includes/
hackedFileIgnoreEndingsHasher.inc, line 14
Class
- hackedFileIgnoreEndingsHasher
- Created by PhpStorm. User: steven Date: 18/02/15 Time: 19:13
Code
function perform_hash($filename) {
if (!hacked_file_is_binary($filename)) {
$file = file($filename, FILE_IGNORE_NEW_LINES);
return sha1(serialize($file));
}
else {
return sha1_file($filename);
}
}