diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-18 01:27:56 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-18 01:28:17 -0700 |
| commit | d5cfaa37be9e278c44a25ef448a071390597306e (patch) | |
| tree | 7fbe78b5153bb9c761c283533943ab80da3a1844 /lib/file_hash.nom | |
| parent | c7c657d38f999901225b33482ef3a15994526feb (diff) | |
Upgrading to version 2.3 (main change: "=" instead of "<-" for
assignment)
Diffstat (limited to 'lib/file_hash.nom')
| -rw-r--r-- | lib/file_hash.nom | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/file_hash.nom b/lib/file_hash.nom index 542b2f2..283c5b4 100644 --- a/lib/file_hash.nom +++ b/lib/file_hash.nom @@ -1,9 +1,8 @@ -#!/usr/bin/env nomsu -V2.2.4.3 +#!/usr/bin/env nomsu -V2.3.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") @@ -19,10 +18,9 @@ action [file with hash %hash]: end action [hash %, sha1 %]: - %hashlib <- (=lua "require('openssl.digest')") - %hash <- (=lua "\%hashlib.new('sha1'):final(\%)") + %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)" -parse [hash of file %filename] as (..) - sha1 (=lua "io.open(\%filename):read('*a')") +parse [hash of file %filename] as (sha1 (=lua "io.open(\%filename):read('*a')"))
\ No newline at end of file |
