Last active
August 29, 2015 14:02
-
-
Save bcicen/a784ab33b7dbe2e320bc to your computer and use it in GitHub Desktop.
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
RANGES="100 1000 10000 100000" | |
for RANGE in $RANGES; do | |
echo "Generating random numbers with a ceiling of $RANGE" | |
while :; do | |
nowtest=$((RANDOM%$RANGE+0)) | |
echo -n $nowtest | |
[[ $nowtest == $lasttest ]] && echo && echo "found side by side collision after $tests tests" && break | |
let tests++ | |
lasttest=$nowtest | |
echo -ne '\b\b\b\b\b\b\b\b\b' | |
done | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment