Test
This commit is contained in:
1 parent
94f821d2a0
commit
a809be2fa0
3 files changed
+187
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
require("../md6.php");
|
||||
|
||||
$md6 = new md6hash();
|
||||
$result = file("result.csv");
|
||||
|
||||
$total = 0;
|
||||
$ok = 0;
|
||||
|
||||
foreach($result as $line) {
|
||||
$a = explode(",", trim($line));
|
||||
$size = intval($a[0]);
|
||||
$data = $a[1];
|
||||
$comp = $a[2];
|
||||
|
||||
$hash = $md6->hex($data, $size);
|
||||
|
||||
$total++;
|
||||
if($hash === $comp) $ok++;
|
||||
}
|
||||
|
||||
echo "{$ok} / {$total} test(s) passed.".PHP_EOL;
|
||||
Reference in new issue
Block a user