1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| package main
import (
"github.com/mojocn/base64Captcha" )
func main() { var configC = base64Captcha.ConfigCharacter{ Height: 88, Width: 240, Mode: base64Captcha.CaptchaModeArithmetic, ComplexOfNoiseText: base64Captcha.CaptchaComplexMedium, ComplexOfNoiseDot: base64Captcha.CaptchaComplexMedium, IsUseSimpleFont: true, IsShowHollowLine: true, IsShowNoiseDot: true, IsShowNoiseText: false, IsShowSlimeLine: true, IsShowSineLine: true, CaptchaLen: 6, } idKeyC, capC := base64Captcha.GenerateCaptcha("", configC) base64Captcha.CaptchaWriteToFile(capC, "./", idKeyC, "png") verifyValue := capC.(*base64Captcha.CaptchaImageChar).VerifyValue base64Captcha.VerifyCaptchaAndIsClear(idKeyC, verifyValue, true) }
|