3 # License: public domain -or- http://www.wtfpl.net/txt/copying/
5 die
() { >&2 printf 'Bail out! %s\n' "$*"; exit 1; }
9 # $1 => value to hash (may contain escapes)
10 # $2 => lowercase sha256 hash expected
16 _check
="$(printf '%b' "$_val" | ./ltsha256)" ||
17 die
"could not run ltsha256 utility"
19 [ "$_check" = "$_hash" ] || _result
="not ok"
20 testnum
="$(( $testnum + 1 ))"
21 printf '%s %u - %s\n' "$_result" "$testnum" "$_test"
28 ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad \
32 "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" \
33 248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1 \
34 abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq
38 15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225 \
42 "The quick brown fox jumped over the lazy dog.\n" \
43 40d5c6f7fe5672fb52269f651c2b985867dfcfa4a5c5258e3d4f8736d5095037 \