Giter VIP home page Giter VIP logo

Comments (4)

dchest avatar dchest commented on August 15, 2024

If you have a bug to report, please provide more details. Otherwise, this issue tracker is not a support forum.

from captcha.

chen406226 avatar chen406226 commented on August 15, 2024

If you have a bug to report, please provide more details. Otherwise, this issue tracker is not a support forum.
I'm want change store.Expiration

  • mycode pg base
    package base
    import (
    "fmt"
    "github.com/dchest/captcha"
    )
    func init() {
    s := captcha.NewMemoryStore(100,30*time.Second)
    // default Expiration = 10 * time.Minute // it's work (no matter when )
    fmt.Println("newStorePointer",&s) // 0xc0003771a0
    captcha.SetCustomStore(s)
    }
    func CreateCap(){
    captcha.NewLen()
    }
    func CapImage(){
    captcha.WriteImage()
    }
    .......
    /////////////////////
    captcha.go
    const (
    // Expiration time of captchas used by default store.
    Expiration = 10 * time.Minute // it's work (no matter when )
    )
    // NewLen is just like New, but accepts length of a captcha solution as the
    // argument.
    func NewLen(length int) (id string) {
    println("storePointer",&globalStore) // 0x13a4570
    id = randomId()
    globalStore.Set(id, RandomDigits(length))
    return
    }

i just wang set new Store (do't set store it's work 😀 nice tool)
i don't know how to check ......
Their Pointer seem to be inconsistent

use go version go1.14.2 windows/amd64

from captcha.

dchest avatar dchest commented on August 15, 2024

Hm... What if you move SetCustomStore outside of the init function, to some kind of manual initialization func (eg InitCaptcha), will it work?

from captcha.

chen406226 avatar chen406226 commented on August 15, 2024

Hm... What if you move SetCustomStore outside of the init function, to some kind of manual initialization func (eg InitCaptcha), will it work?

no work😟

from captcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.