Skip to content

Instantly share code, notes, and snippets.

@trajakovic
Created April 20, 2017 06:48
Embed
What would you like to do?
Generate binary files with random content...and calculate their sha256
#!/bin/bash
#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
done
done
#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