All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.kaizen4j.shiro.captcha.SimpleCaptchaEngine Maven / Gradle / Ivy

The newest version!
package com.github.kaizen4j.shiro.captcha;

import com.wf.captcha.SpecCaptcha;
import com.wf.captcha.base.Captcha;
import java.io.OutputStream;

/**
 * @author liuguowen
 */
public class SimpleCaptchaEngine implements CaptchaEngine {

    private SpecCaptcha specCaptcha;

    public SimpleCaptchaEngine() {
        SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
        specCaptcha.setCharType(Captcha.TYPE_NUM_AND_UPPER);
        this.specCaptcha = specCaptcha;
    }

    @Override
    public void write(OutputStream outputStream) {
        specCaptcha.out(outputStream);
    }

    @Override
    public String getText() {
        return specCaptcha.text();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy