title: checksums on zip files
body: <p>I am currently working on a tool that uploads a group of files, then uses md5 checksums to compare the files to the last batch that were uploaded and tells you which files have changed. </p>
  
  <p>For regular files this is working fine but some of the uploaded files are zip archives, which almost always have changed, even when the files inside it are the same. </p>
  
  <p>Is there a way to perform a different type of checksum to check if these files have changed without having to unzip each one individually and then comparing the contents of each file individually.</p>
  
  <p>Here is my current function</p>
  
  <pre><code>function check_if_changed($date, $folder, $filename)
  {
    $dh = opendir('./wp-content/uploads/Base/');
    while (($file = readdir($dh)) !== false) {
      $folders[] = $file;
    }
    sort($folders);
    $position = array_search($date, $folders);
    $prev_folder = $folders[$position - 1];
    if ($prev_folder == '.' || $prev_folder == '..')
      { return true;}
    $newhash = md5_file('./wp-content/uploads/Base/'.$date.'/'.$folder.'/'.$filename);
    $oldhash = md5_file('./wp-content/uploads/Base/'.$prev_folder.'/'.$folder.'/'.$filename);
    if ($oldhash != $newhash){
      return true;
    }
    return false;
  }
  </code></pre>