From 96d539f76b80473cadfe3e8be876ed9bf24a303d Mon Sep 17 00:00:00 2001 From: Max Kirmair Date: Tue, 18 Mar 2025 11:58:35 +0100 Subject: [PATCH 1/2] Remove wrong closing bracket "]" in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8298e2c..62671ef 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ $altcha = new Altcha('secret hmac key'); $options = new ChallengeOptions( maxNumber: 50000, // the maximum random number expires: (new \DateTimeImmutable())->add(new \DateInterval('PT10S')), -]); +); $challenge = $altcha->createChallenge($options); echo "Challenge created: " . json_encode($challenge) . "\n"; @@ -80,7 +80,7 @@ $options = new ChallengeOptions( expires: (new \DateTimeImmutable())->add(new \DateInterval('PT10S')), params: ['query_param' => '123'], saltLength: ChallengeOptions::DEFAULT_SALT_LENGTH -]); +); ``` ### `Altcha::verifySolution(array|string $payload, bool $checkExpires): bool` From 67546db44f318bcc0f085e763e52908956500e93 Mon Sep 17 00:00:00 2001 From: Max Kirmair Date: Tue, 18 Mar 2025 12:06:34 +0100 Subject: [PATCH 2/2] fix false example --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62671ef..6b453d8 100644 --- a/README.md +++ b/README.md @@ -75,11 +75,11 @@ Creates a new challenge for ALTCHA. ```php $options = new ChallengeOptions( - algorithm: ChallengeOptions::DEFAULT_ALGORITHM, - maxNumber: ChallengeOptions::DEFAULT_MAX_NUMBER, + algorithm: Algorithm::SHA256, + maxNumber: BaseChallengeOptions::DEFAULT_MAX_NUMBER, expires: (new \DateTimeImmutable())->add(new \DateInterval('PT10S')), params: ['query_param' => '123'], - saltLength: ChallengeOptions::DEFAULT_SALT_LENGTH + saltLength: 12 ); ```