summaryrefslogtreecommitdiff
path: root/multihash
diff options
context:
space:
mode:
Diffstat (limited to 'multihash')
-rw-r--r--multihash/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/multihash/__init__.py b/multihash/__init__.py
new file mode 100644
index 0000000..5bcf4d5
--- /dev/null
+++ b/multihash/__init__.py
@@ -0,0 +1,11 @@
+from _multihash import *
+
+def file_hash(name):
+ h = Multihash()
+ f = open(name)
+ data = f.read(32768)
+ while data:
+ h.update(data)
+ data = f.read(32768)
+ f.close()
+ return h \ No newline at end of file