MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / WriteImage

Method WriteImage

internal/waf/captcha_generator.go:37–44  ·  view source on GitHub ↗

WriteImage write image to front writer

(w io.Writer, id string, width, height int)

Source from the content-addressed store, hash-verified

35
36// WriteImage write image to front writer
37func (this *CaptchaGenerator) WriteImage(w io.Writer, id string, width, height int) error {
38 var d = this.store.Get(id, false)
39 if d == nil {
40 return captcha.ErrNotFound
41 }
42 _, err := captcha.NewImage(id, d, width, height).WriteTo(w)
43 return err
44}
45
46// Verify user input
47func (this *CaptchaGenerator) Verify(id string, digits string) bool {

Callers 4

TestCaptchaMemoryFunction · 0.80
showVerifyImageMethod · 0.80

Calls 2

WriteToMethod · 0.65
GetMethod · 0.45

Tested by 3

TestCaptchaMemoryFunction · 0.64