package captcha import ( "github.com/mojocn/base64Captcha" ) // Generate 產生驗證圖示 func Generate() (string, string, error) { driver := base64Captcha.NewDriverDigit(80, 160, 4, 0.1, 4) return base64Captcha.NewCaptcha(driver, base64Captcha.DefaultMemStore).Generate() } // Verify 驗證驗證碼 func Verify(id, code string) bool { return base64Captcha.DefaultMemStore.Verify(id, code, true) }