Skip to content

Instantly share code, notes, and snippets.

Created April 20, 2017 06:48
What would you like to do?
Generate binary files with random content...and calculate their sha256
#size magnitude
sizes=( "" "K" "M" )
for magnitude in "${sizes[@]}"; do
for size in `seq 1 5 51`; do
echo "Generating ${size}${magnitude}"
head -c ${size}${magnitude} </dev/urandom >file-${size}${magnitude}.bin
#generate sha256checksums
rm -f sha256checksums
find . -name "*.bin" -type f -exec sha256sum "{}" + > sha256checksums
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment