Catchup 1.3.0

dotnet add package Catchup --version 1.3.0
NuGet\Install-Package Catchup -Version 1.3.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="Catchup" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Catchup --version 1.3.0
#r "nuget: Catchup, 1.3.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 Catchup as a Cake Addin
#addin nuget:?package=Catchup&version=1.3.0

// Install Catchup as a Cake Tool
#tool nuget:?package=Catchup&version=1.3.0

Catchup

Catchup is a simple nuget package made with .Net Core for Persians

Description

Catchup produces a random 4 digits number in words as a string to be read by human beings. Users must enter the exact match of the number generated to become validated as a non-robotic user.

Setup

I recommend to inject the interface "ICatchup" as a dependency so you can access the methods and use them inside your "Business layer".

How it works

Get a captcha as string

  • To get a generated random captcha, use GetACaptcha() method. This method takes no argument and return a string which contains 4 digits number in words as a captcha riddle.

Get a captcha in image as byte array

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

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 GetACaptcha() 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 the user 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. 
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
1.3.0 981 5/24/2022
1.2.0 924 5/16/2022
1.1.1 911 5/15/2022
1.1.0 889 5/15/2022
1.0.0 881 5/15/2022

Please feel free to contribute