Initial Commit resolving issues from Snack-X/md6

This commit is contained in:
Amrit Panesar committed 2017-04-13 13:28:08 -07:00
1 parent 9a94a59b4b
commit 5fa1e853d3
13 files changed
+776 -849

No files matched your search

-23
View File
@@ -1,23 +0,0 @@
<?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;
-24
View File
@@ -1,24 +0,0 @@
import sys
sys.path.append("..")
from md6 import md6hash
md6 = md6hash()
f = open("result.csv", "r")
result = f.readlines()
f.close()
total = 0
ok = 0
for line in result:
size, data, comp = line.strip().split(",")
size = int(size)
hash = md6.hex(data, size)
total += 1
if hash == comp:
ok += 1
print "%d / %d test(s) passed." % (ok, total)