Files
colorhash/tools/genexamples.sh
Alek Ratzloff 4a9225d27f Add a tool that will generate examples using all matrix and hash options
This tool will go through the examples directory and generate an image
for all *.in files using every hash and matrix option.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-22 10:57:36 -07:00

20 lines
536 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
here="$(dirname "$(realpath "$0")")"
hashes=(md5 sha1 sha224 sha256 sha384 sha512)
matrices=(nibble randomart)
cd "$here/.."
find "examples" -type f -name '*.in' | \
while read infile; do
for hash in "${hashes[@]}"; do
for matrix in "${matrices[@]}"; do
outfile="examples/$(basename -s .in "$infile")-$hash-$matrix.svg"
echo "Generating $outfile"
python3 -m colorhash "$infile" --out "$outfile" --hash "$hash" --matrix "$matrix"
done
done
done