Comincio io col postare qualche pezzo di codice:
SCRIPT PER HASH DI TUTTI I FILE IN UNA DIRECTORY
Codice PHP:
<?php
$files = scandir('..');
for ($i=0;$i<count($files);$i++)
{
$file2 = realpath($files[$i]);
if (!is_dir($file2))
$hash = sha1_file($file2);
else
$hash = 'Dir';
echo '<tr><td>'.$i.'</td><td>'.$file2.'</td><td>'.$hash.'</td><td>'.date ("F d Y H:i:s.",filemtime($file2)).'</td></tr>';
$i;
}
?>
Questa è invece una funzione che fa la stessa cosa:
Codice PHP:
function verfiyFiles($path) {
$files = scandir($path);
for ($i=0;$i<count($files);$i++)
{
$file2 = realpath($files[$i]);
if (!is_dir($file2))
$hash = sha1_file($file2);
else
$hash = 'Dir';
echo '<tr><td>'.$i.'</td><td>'.$file2.'</td><td>'.$hash.'</td><td>'.date ("F d Y H:i:s.",filemtime($file2)).'</td></tr>';
$i;
}
}