captcha

package
v0.0.0-...-8b501b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChallengeUser

func ChallengeUser(c Challenger, p Prompter) bool

ChallengeUser requests a challenge from c and prompts the user for an answer using p. If the user's answer matches the challenge then ChallengeUser returns true. All comparisons are performed using constant-time checks to prevent information leaks.

Types

type Challenger

type Challenger interface {
	Challenge() (img image.Image, imgText string)
}

Challenger is implemented by objects that can generate CAPTCHA image challenges.

type Prompter

type Prompter interface {
	Prompt(img image.Image) string
}

Prompter is implemented by objects that display a CAPTCHA image to the user, ask them to type their contents and return back their response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL