Class SliderCaptchaGenerator

java.lang.Object
cloud.opencode.base.captcha.interactive.SliderCaptchaGenerator
All Implemented Interfaces:
CaptchaGenerator

public final class SliderCaptchaGenerator extends Object implements CaptchaGenerator
Slider Captcha Generator - Generates slider verification CAPTCHA 滑块验证码生成器 - 生成滑块验证验证码

This generator creates slider-based interactive CAPTCHAs.

此生成器创建基于滑块的交互式验证码。

Features | 主要功能:

  • Slider puzzle verification - 滑块拼图验证
  • Position-based challenge - 基于位置的挑战

Usage Examples | 使用示例:

CaptchaGenerator gen = new SliderCaptchaGenerator();
Captcha captcha = gen.generate(config);

Security | 安全性:

  • Thread-safe: Yes (stateless) - 线程安全: 是(无状态)
  • Null-safe: No (config must not be null) - 空值安全: 否(配置不能为null)
  • Low entropy: Slider position has ~width possible values. Must be used with BehaviorAnalyzer and CaptchaRateLimiter for adequate protection. 低熵: 滑块位置约有 width 种可能值。必须配合 BehaviorAnalyzer 和 CaptchaRateLimiter 使用。
Since:
JDK 25, opencode-base-captcha V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • SliderCaptchaGenerator

      public SliderCaptchaGenerator()
  • Method Details

    • generate

      public Captcha generate(CaptchaConfig config)
      Description copied from interface: CaptchaGenerator
      Generates a CAPTCHA with the specified configuration. 使用指定配置生成验证码。
      Specified by:
      generate in interface CaptchaGenerator
      Parameters:
      config - the configuration | 配置
      Returns:
      the generated CAPTCHA | 生成的验证码
    • getType

      public CaptchaType getType()
      Description copied from interface: CaptchaGenerator
      Gets the supported CAPTCHA type. 获取支持的验证码类型。
      Specified by:
      getType in interface CaptchaGenerator
      Returns:
      the CAPTCHA type | 验证码类型