Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

centrifuge.hectabit.org/HectaBit/captcha

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

centrifuge.hectabit.org/HectaBit/captcha

Go
Version
v1.4.4
Version published
Created
Source

Package captcha provides an easy to use, unopinionated API for captcha generation.

PkgGoDev Go Report Card

Why another captcha generator?

Because I can.

install

go get centrifuge.hectabit.org/HectaBit/captcha

usage

func handle(w http.ResponseWriter, r *http.Request) {
	// create a captcha of 150x50px
	data, _ := captcha.New(150, 50)

	// session come from other library such as gorilla/sessions
	session.Values["captcha"] = data.Text
	session.Save(r, w)
	// send image data to client
	data.WriteImage(w)
}

documentation | example | font example

sample image

image

image

Compatibility

This package uses embed package from Go 1.16. If for some reasons you have to use pre 1.16 version of Go, reference pre 1.4 version of this module in your go.mod.

Contributing

If your found a bug, please contribute! see contributing.md for more detail.

License

MIT

FAQs

Package last updated on 01 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts