Last active
September 20, 2024 02:07
-
-
Save SafeEval/8bf756c1a3b465bb00f3e048bc978573 to your computer and use it in GitHub Desktop.
Generate the sha256 hashes of all six digit OTPs in 970 seconds (16 minutes, 69 MB)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OUTFILE="otp-hashes.csv" | |
function gen_hash() { | |
otp=$1; | |
hash=$(echo -n $otp | sha256sum | awk '{print $1}'); | |
echo "$otp,$hash" >> $OUTFILE; | |
} | |
start=$(date +%s) | |
for otp in $(seq -w 000000 999999); do | |
gen_hash $otp & | |
echo "$otp"; | |
done | |
wait | |
end=$(date +%s) | |
elapsed=$(( end - start )) | |
echo "Elapsed time: $elapsed seconds" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment