You are here

function hackedFileIgnoreEndingsHasher::perform_hash in Hacked! 6.2

Same name and namespace in other branches
  1. 7.2 includes/hackedFileIgnoreEndingsHasher.inc \hackedFileIgnoreEndingsHasher::perform_hash()

Returns a hash of the given filename.

Ignores file line endings.

Overrides hackedFileHasher::perform_hash

File

includes/hacked_project.inc, line 740

Class

hackedFileIgnoreEndingsHasher

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);
  }
}