-
Notifications
You must be signed in to change notification settings - Fork 0
NCaptcha.CaptchaFactories.Base
NCaptcha.CaptchaFactories.Base is a library in this repository. Its full name and package id on nuget.org is Nololiyt.Captcha.CaptchaFactories.Base.
This library provides an abstract class called StaticAnswerCaptchaFactory<TAnswer> which can help simplify the process of implementing a ICaptchaFactory<TCaptchaDisplay, TAnswer>.
There is an interface called ICaptchaAnswerSaver<TAnswer> which can save and get static captcha answer.
The interface will mostly be used in a StaticAnswerCaptchaFactory<TAnswer>, but the TAnswers of the two types don't necessarily the same. For example, a StaticAnswerCaptchaFactory<Point> may just use an existed third-party ICaptchaAnswerSaver<KeyValuePair<int,int>>.
TAnswer is recommended to be a reference type or a nullable value type, so that TryGetAsync(string, CancellationToken) can return null to represent that there isn't such an answer or the answer has expired.
We recommend TryGetAsync(string, CancellationToken) to make the answer invalid in the meantime.
In this current repository:
NCaptcha.AnswerSavers.InMemoryGuidDictionaryNCaptcha.CaptchaFactories.BaseNCaptcha.CaptchaFactories.ImageNCaptcha.TicketFactories.InMemoryGuidDictionary
In other repositories: