diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-03-20 15:55:57 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-03-20 15:55:57 -0700 |
| commit | e665d9725c4bb02f4c18d16527367f424cb880fa (patch) | |
| tree | aed161ee6b338c2bad2312591f746459414ccafa /lib/file_hash | |
| parent | 606fd090002f3d545cbd58440e96624907846f45 (diff) | |
Auto-updated to 7.0.0 syntax and removed some shims.
Diffstat (limited to 'lib/file_hash')
| -rw-r--r-- | lib/file_hash/init.nom | 11 |
1 files changed, 6 insertions, 5 deletions
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: |
