Python test
This commit is contained in:
1 parent
a809be2fa0
commit
9a94a59b4b
3 files changed
+73
-3
No files matched your search
+46
@@ -0,0 +1,46 @@
|
|||||||
|
# Windows
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
|
||||||
|
# Mac OS X
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear on external disk
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
|
||||||
|
*.pyc
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
# md6hash for Python 2, 3
|
# md6hash for Python 2, 3
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# md6 = md6hash();
|
# md6 = md6hash()
|
||||||
# data = "md6 FTW";
|
# data = "md6 FTW"
|
||||||
# result = md6.hex(data);
|
# result = md6.hex(data)
|
||||||
# print(result)
|
# print(result)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
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)
|
||||||
Reference in new issue
Block a user