From 54f0711294eebe2b2891160997de1f567e0b1715 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Thu, 14 Jan 2021 12:25:00 +0100 Subject: [PATCH] Captcha : more simple addition --- captcha/captcha.sh | 4 +++- captcha/experimental.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/captcha/captcha.sh b/captcha/captcha.sh index 756ddfb..6070072 100755 --- a/captcha/captcha.sh +++ b/captcha/captcha.sh @@ -80,7 +80,9 @@ INTRUS() SOMME() { get_random - RA=$(($R % 100)) + RB=$(($R % 5)) + get_random + RA=$(($R % 10 * (10 ** $RB))) if [[ $(($INPUT % 2)) -eq 0 ]]; then A=$(($INPUT - $RA)) diff --git a/captcha/experimental.sh b/captcha/experimental.sh index c97c222..e772fd1 100755 --- a/captcha/experimental.sh +++ b/captcha/experimental.sh @@ -115,7 +115,7 @@ RAND_INDEX=$(($R % ${#TRANSFORMATIONS[@]})) convert -size 300x60 xc:none -pointsize 20 \ \( -clone 0 -fill black \ -stroke black -strokewidth 1 \ - -annotate "${RAND_ANGLE}x${RAND_ITALIC}+0+0" "\n $(${TRANSFORMATIONS[1]})" \ + -annotate "${RAND_ANGLE}x${RAND_ITALIC}+0+0" "\n $(${TRANSFORMATIONS[$RAND_INDEX]})" \ -roll +$ROLL_X+0 \ -wave "$WAVE1_AMPLITUDE"x"$WAVE1_LENGTH" \ -roll -$ROLL_X+0 \) \