/CaptchaGenerator

.Net cross-platform captcha generator with SixLabors library on .NET Core

Primary LanguageC#MIT LicenseMIT

.NET Windows x64 .NET Ubuntu x64 NuGet NuGet License Generic badge

Captcha Generator .Net

Captcha Generator is a simple cross-platform library for generating image captcha.

Features

  • Simple & Cross-Platform
  • Compatible with Linux and Windows
  • Compatible with Docker images based on Linux :)

Installing via NuGet

PM> Install-Package Captcha.Net

Installing via the .NET Core command line interface

dotnet add package Captcha.Net

Usage:

using Captcha.Net;

namespace ConsoleAppSample
{
	class Program
	{
		static void Main(string[] args)
		{
			var captchaGenerator = new CaptchaGenerator();
			var key = captchaGenerator.GenerateCaptchaCode();
			var result = captchaGenerator.GenerateCaptchaImage(200, 100, key);
			File.WriteAllBytes($"captcha.jpg", result.CaptchaByteData);

			Console.WriteLine(result.CaptchBase64Data);
		}
	}
}