aboutsummaryrefslogtreecommitdiff
path: root/lib/file_hash.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-20 20:27:15 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-20 20:27:27 -0700
commit6728587dfc6a5f4090f2673113ffedb2be924daf (patch)
tree77591abacd8760bedaa30110570613ef263220fe /lib/file_hash.nom
parentc9df1bc3e881b2ebcf5808a0db7bea29cd07c849 (diff)
Auto-formatted and auto-upgraded everything!
Diffstat (limited to 'lib/file_hash.nom')
-rw-r--r--lib/file_hash.nom6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/file_hash.nom b/lib/file_hash.nom
index 49c768f..7c5668e 100644
--- a/lib/file_hash.nom
+++ b/lib/file_hash.nom
@@ -1,8 +1,9 @@
-#!/usr/bin/env nomsu -V2.4.4.3
+#!/usr/bin/env nomsu -V2.5.4.3
#
This file defines some actions for hashing files and looking up files by hash.
use "core"
+
action [file with hash %hash]:
lua> ".."
local Hash = require("openssl.digest")
@@ -21,6 +22,7 @@ action [hash %, sha1 %]:
%hashlib = (=lua "require('openssl.digest')")
%hash = (=lua "\%hashlib.new('sha1'):final(\%)")
return (..)
- =lua "\%hash:gsub('.', function(c) return string.format('%02x', string.byte(c)) end)"
+ =lua ".."
+ \%hash:gsub('.', function(c) return string.format('%02x', string.byte(c)) end)
parse [hash of file %filename] as (sha1 (=lua "io.open(\%filename):read('*a')")) \ No newline at end of file