Catchup 2.0.2

dotnet add package Catchup --version 2.0.2
                    
NuGet\Install-Package Catchup -Version 2.0.2
                    
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="Catchup" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Catchup" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Catchup" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Catchup --version 2.0.2
                    
#r "nuget: Catchup, 2.0.2"
                    
#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.
#:package Catchup@2.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Catchup&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Catchup&version=2.0.2
                    
Install as a Cake Tool

Catchup

Catchup is a simple nuget package made with C#.

Description

Catchup produces a random 6 characters Alphanumeric string to be read by human beings. Users must enter the exact match of the text generated to become validated as a non-robotic user.

Setup

I recommend to make an instance of "Catchupper" class so you can access the methods and use them inside your business layer, or you can easily register the class "Catchupper" with its interface "ICatchup" as a dependency in Dependency Container and inject it in your own class.

How it works

Get a captcha in image as byte array

  • To get a generated random captcha image, use GetAnImageCaptcha() method. This method returns an object which contains a captcha string and a byte array that you can use directly in image tag.

  • You can also customize the output by passing an optional CaptchaOptions object to the method:

var customOptions = new CaptchaOptions
{
    Width = 250,
    Height = 100,
    FontSize = 50,
    CaptchaLength = 5,
    LineNoiseCount = 20,
    DotNoiseCount = 300
};

var captcha = catchup.GetAnImageCaptcha(customOptions);

Examples in UI

  • Example in html pages:
<img style="width:500px;" src='data:image/png;base64, ' + imageInByteArray" />
  • Example in razor pages:
<img style="width:500px;" src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(imageInByteArray))" />"

Solve the captcha

  • To validate user as a non-robotic one, use CheckCaptcha(string riddle, string solution). This method accepts two required arguments as the riddle and solution of it. the first one is the string you got from GetAnImageCaptcha() method and the second one (solution) is the number user sends as the answer. the method returns a boolean which determines if the answer is correct or not.

Important

It is obvious that to prevent from attacks, you better store the generated captcha with a unique Id who is requesting for it, so the attacker can't send you the similar riddle and his solution. This package is not doing it as it maybe differences in different project flows.

From author

Of course that this package is not perfect and can be extended in many ways. Please FEEL FREE TO CONTRIBUTE, DEVELOP AND FIX BUGS by a pull request. I'd be glad to hear your suggestions or anything else from you through alireza_mortezaei@hotmail.com

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 29 8/26/2025
2.0.1 121 7/15/2025
2.0.0 152 7/1/2025
1.3.0 1,110 5/24/2022
1.2.0 1,020 5/16/2022
1.1.1 1,015 5/15/2022
1.1.0 984 5/15/2022
1.0.0 975 5/15/2022

Please feel free to contribute