diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-30 14:16:09 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-30 14:16:18 -0700 |
| commit | 18126da9c538046a93715d829722c818773b9ac1 (patch) | |
| tree | 3a88e43636b85534ded21abd9f9f106b8ffbc037 /lib/file_hash.nom | |
| parent | ba00294badff9d5f5d55e1080a17b13fea961f55 (diff) | |
Auto-upgraded to 3.7
Diffstat (limited to 'lib/file_hash.nom')
| -rw-r--r-- | lib/file_hash.nom | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/file_hash.nom b/lib/file_hash.nom index bce8c08..35b8340 100644 --- a/lib/file_hash.nom +++ b/lib/file_hash.nom @@ -1,12 +1,11 @@ -#!/usr/bin/env nomsu -V3.6.5.6 +#!/usr/bin/env nomsu -V3.7.5.6 # This file defines some actions for hashing files and looking up files by hash. use "lib/os.nom" use "lib/base64.nom" -lua> ".." - local \%use_sha1, \%hashlib = pcall(require, 'openssl.digest') +lua> "local \%use_sha1, \%hashlib = pcall(require, 'openssl.digest')" test: assume ((hash "hello world") == (hash "hello world")) @@ -14,13 +13,16 @@ test: Hash collision: (hash "hello world") = \(hash "hello world") (hash "goodbye") = \(hash "goodbye") + assume (..) (..) hash ".." This is a really long string meant to stress test the hashing function and ensure that it's not overflowing with long inputs. ..!= "inf" - assume ((hash "\0") != (hash "\0\0\0\0\0")) or barf "Incorrect hashing of null strings" + + assume ((hash "\000") != (hash "\000\000\000\000\000")) or barf ".." + Incorrect hashing of null strings if %use_sha1: assume ((hash "hello world") == "Kq5sNclPz7QV2+lfQIuc6R7oRu0=") if %use_sha1: |
