aboutsummaryrefslogtreecommitdiff
path: root/lib/file_hash.nom
diff options
context:
space:
mode:
Diffstat (limited to 'lib/file_hash.nom')
-rw-r--r--lib/file_hash.nom4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/file_hash.nom b/lib/file_hash.nom
index aef1c78..2f9076e 100644
--- a/lib/file_hash.nom
+++ b/lib/file_hash.nom
@@ -9,7 +9,6 @@ use "lib/base64.nom"
test:
assume ((hash "hello world") == "Kq5sNclPz7QV2+lfQIuc6R7oRu0=")
-
action [hash %, sha1 %]:
%hash = (=lua "\%hashlib.new('sha1'):final(\%)")
return (base64 %hash)
@@ -18,7 +17,6 @@ action [file with hash %hash]:
for file %filename in ".":
%contents = (read file %filename)
%file_hash = (hash %contents)
- if (%file_hash == %hash):
- return %filename
+ if (%file_hash == %hash): return %filename
parse [hash of file %filename] as (sha1 (read file %filename))