aboutsummaryrefslogtreecommitdiff
path: root/lib/file_hash.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-02 15:17:48 -0700
committerBruce Hill <bruce@bruce-hill.com>2018-11-02 15:17:49 -0700
commit0f17c5eb9ac4660f2f969bd1e67af42713e45eac (patch)
tree279ca7da2de0efe2f363684f3c84a540635f11a8 /lib/file_hash.nom
parentacd9c2acd4688f2301b091daad910c04e402bd6a (diff)
parentdc41f30c73c9686685e3a4183c1213fb4ba55c90 (diff)
Merge branch 'master' into working
Diffstat (limited to 'lib/file_hash.nom')
-rw-r--r--lib/file_hash.nom10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/file_hash.nom b/lib/file_hash.nom
index 6fdb2f4..6c815f5 100644
--- a/lib/file_hash.nom
+++ b/lib/file_hash.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.8.8.6
+#!/usr/bin/env nomsu -V4.8.10
#
This file defines some actions for hashing files and looking up files by hash.
@@ -26,14 +26,14 @@ test:
if %use_sha1:
assume ((hash "hello world") == "Kq5sNclPz7QV2+lfQIuc6R7oRu0=")
if %use_sha1:
- action [hash %]:
+ externally (hash %) means:
%hash = (=lua "\%hashlib.new('sha1'):final(\%)")
return (base64 %hash)
..else:
# TODO: remove warning?
say "\
..\027[31;1mWARNING: OpenSSL module not found. Defaulting to a non-cryptographically secure hash function.\027[0m"
- action [hash %]:
+ externally (hash %) means:
%bytes = (%::bytes)
%hash = (%bytes.1 << 7)
for %i in 2 to (size of %bytes):
@@ -41,10 +41,10 @@ if %use_sha1:
%hash = (%hash ~ (size of %bytes))
return "\%hash"
-action [file with hash %hash]:
+externally (file with hash %hash) means:
for file %filename in ".":
%contents = (read file %filename)
%file_hash = (hash %contents)
if (%file_hash == %hash): return %filename
-parse [hash of file %filename] as (hash (read file %filename))
+(hash of file %filename) parses as (hash (read file %filename))