WonderfulTools.WonderfulCaptcha 10.2.0

dotnet add package WonderfulTools.WonderfulCaptcha --version 10.2.0                
NuGet\Install-Package WonderfulTools.WonderfulCaptcha -Version 10.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WonderfulTools.WonderfulCaptcha" Version="10.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WonderfulTools.WonderfulCaptcha --version 10.2.0                
#r "nuget: WonderfulTools.WonderfulCaptcha, 10.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install WonderfulTools.WonderfulCaptcha as a Cake Addin
#addin nuget:?package=WonderfulTools.WonderfulCaptcha&version=10.2.0

// Install WonderfulTools.WonderfulCaptcha as a Cake Tool
#tool nuget:?package=WonderfulTools.WonderfulCaptcha&version=10.2.0                

Wonderful Captcha

Wonderful Captcha is a simple and customizable CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) implementation for .NET applications.

Features

  • Generate custom CAPTCHA images with random text.
  • Easily integrate CAPTCHA functionality into your .NET web forms or applications.
  • Customizable CAPTCHA image size, font, text color, background color, and noise level.

Usage

1- You can install Wonderful Captcha via NuGet Package Manager:

Install-Package WonderfulCaptcha

2- Use extension To Add WonderfulCaptcha

using WonderfulCaptcha;

// use extension to add wonderfulcaptcha to project
builder.Services.AddWonderfulCaptcha();

3- Generate CAPTCHA image in controler, service, ...

[ApiController]
[Route("[controller]/[action]")]
public class TestController : ControllerBase
{
    private readonly IWonderfulCaptchaService _wonderfulCaptchaService;
    public TestController(IWonderfulCaptchaService wonderfulCaptchaService)
    {
        _wonderfulCaptchaService = wonderfulCaptchaService;
    }

    [HttpGet]
    public async Task<ActionResult> GenerateAsync(CancellationToken cancellationToken)
    {
        var value = await _wonderfulCaptchaService.GenerateAsync(cancellationToken: cancellationToken);
        return Ok(value);
    }
}

4- Verify CAPTCHA

var result = await _wonderfulCaptchaService.VerifyAsync(key, value, cancellationToken);

Here's an improved version of your package markdown file:

Caching

When using WonderfulCaptcha, you have the flexibility to choose from various cache providers to optimize performance and resource management.

InMemoryCache

The InMemoryCache provider is suitable for smaller applications or scenarios where you prefer an in-memory caching mechanism.

Installation

Install-Package WonderfulTools.WonderfulCaptcha.Cache.InMemory

Usage

builder.Services.AddMemoryCache();
builder.Services.AddWonderfulCaptcha(o =>
{
    o.UseInMemoryCacheProvider();
});

RedisCache

For larger applications or distributed environments, RedisCache is an efficient choice due to its scalability and robustness.

Installation

Install-Package WonderfulTools.WonderfulCaptcha.Cache.Redis

Usage

builder.Services.AddStackExchangeRedisCache(options =>
{
    options.Configuration = "localhost:6379";
    options.InstanceName = "MyRedisInstance"; 
});
builder.Services.AddWonderfulCaptcha(o =>
{
    o.UseRedisCacheProvider();
});

Custom Cache Provider

If you have specific caching requirements or wish to integrate with a different caching system, you can implement your own cache provider by implementing the ICacheProvider interface.

Usage

  1. Implement your custom cache provider:
public class MyCacheProvider : ICacheProvider
{
    // Your Implementation Here
}
  1. Register your custom cache provider:
builder.Services.AddWonderfulCaptcha(o =>
{
    o.UseCustomCacheProvider<MyCacheProvider>();
});

By providing these options, WonderfulCaptcha ensures compatibility with various caching strategies, allowing you to optimize your application's performance according to your specific needs.

In this version, I've organized the content into clear sections for each cache provider, provided clear installation and usage instructions, and improved the overall readability of the document. Additionally, I've added more descriptive text to explain the benefits and use cases of each cache provider.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on WonderfulTools.WonderfulCaptcha:

Package Downloads
WonderfulTools.WonderfulCaptcha.Cache.InMemory

use in memory cache in wonderful captcha.

WonderfulTools.WonderfulCaptcha.Cache.Redis

use Redis cache in wonderful captcha.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
10.2.0 119 6/12/2024
10.0.1 696 3/11/2024
10.0.0 358 2/18/2024
8.0.1 425 1/15/2024
7.0.1 436 1/15/2024

migrate to new version of SixLabors.ImageSharp and add new strategy