Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/lifei6671/gocaptcha
一个简单的Go语言实现的验证码
基于Golang实现的图片验证码生成库,可以实现随机字母个数,随机直线,随机噪点等。可以设置任意多字体,每个验证码随机选一种字体展示。
go get github.com/lifei6671/gocaptcha
go get github.com/golang/freetype
go get github.com/golang/freetype/truetype
go get golang.org/x/image
具体实例可以查看example目录,有生成的验证码图片。
func Get(w http.ResponseWriter, r *http.Request) {
captchaImage := gocaptcha.New(dx, dy, gocaptcha.RandLightColor())
err := captchaImage.
DrawBorder(gocaptcha.RandDeepColor()).
DrawNoise(gocaptcha.NoiseDensityHigh, gocaptcha.NewTextNoiseDrawer(gocaptcha.DefaultDPI)).
DrawNoise(gocaptcha.NoiseDensityLower, gocaptcha.NewPointNoiseDrawer()).
DrawLine(gocaptcha.NewBezier3DLine(), gocaptcha.RandDeepColor()).
DrawText(gocaptcha.NewTwistTextDrawer(gocaptcha.DefaultDPI, gocaptcha.DefaultAmplitude, gocaptcha.DefaultFrequency), gocaptcha.RandText(4)).
DrawLine(gocaptcha.NewBeeline(), gocaptcha.RandDeepColor()).
//DrawLine(gocaptcha.NewHollowLine(), gocaptcha.RandLightColor()).
DrawBlur(gocaptcha.NewGaussianBlur(), gocaptcha.DefaultBlurKernelSize, gocaptcha.DefaultBlurSigma).
Error
if err != nil {
fmt.Println(err)
}
_ = captchaImage.Encode(w, gocaptcha.ImageFormatJpeg)
}
// 初始化字体
func init() {
err := gocaptcha.SetFontPath("../fonts/")
if err != nil {
panic(err)
}
}
FAQs
Unknown package
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.