From e665d9725c4bb02f4c18d16527367f424cb880fa Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 20 Mar 2019 15:55:57 -0700 Subject: Auto-updated to 7.0.0 syntax and removed some shims. --- lib/file_hash/init.nom | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/file_hash') diff --git a/lib/file_hash/init.nom b/lib/file_hash/init.nom index bbf1060..81061f9 100644 --- a/lib/file_hash/init.nom +++ b/lib/file_hash/init.nom @@ -1,5 +1,6 @@ -#!/usr/bin/env nomsu -V6.15.13.8 -# +#!/usr/bin/env nomsu -V7.0.0 + +### This file defines some actions for hashing files and looking up files by hash. use "filesystem" @@ -37,7 +38,7 @@ if $use_sha1: $hash = (=lua "\$hashlib.new('sha1'):final(\$)") return (base64 $hash) ..else: - # TODO: remove warning? + ### TODO: remove warning? say (" \027[31;1mWARNING: OpenSSL module not found. Defaulting to a non-cryptographically secure \ ..hash function.\027[0m @@ -47,9 +48,9 @@ if $use_sha1: (hash $) means: $bytes = ($, bytes) $hash = ($bytes.1 << 7) - for $i in 2 to (#$bytes): + for $i in (2 to #$bytes): $hash = ((1000003 * $hash) ~ $bytes.$i) - $hash = ($hash ~ (#$bytes)) + $hash = ($hash ~ #$bytes) return "\$hash" external: -- cgit v1.2.3