- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractStrategy,MathStrategy,RandomStrategy
CAPTCHA code generation strategy.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
-
Method Details
-
generate
String generate()Generates the CAPTCHA code.- Returns:
- The CAPTCHA code.
-
verify
Verifies if the user's input string matches the generated CAPTCHA code. Users can define their own matching logic by implementing this method.- Parameters:
code- The randomly generated CAPTCHA code.userInputCode- The CAPTCHA code entered by the user.- Returns:
- Whether the verification is successful.
-