From 6d1548b3339323ae2806af590db1e879037dddbd Mon Sep 17 00:00:00 2001 From: Eugene Fox Date: Wed, 18 Sep 2024 16:13:30 +0300 Subject: [PATCH] Created simpleotp.hashalgorithmproviders.md (markdown) --- simpleotp.hashalgorithmproviders.md.md | 91 ++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 simpleotp.hashalgorithmproviders.md.md diff --git a/simpleotp.hashalgorithmproviders.md.md b/simpleotp.hashalgorithmproviders.md.md new file mode 100644 index 0000000..c45a4c7 --- /dev/null +++ b/simpleotp.hashalgorithmproviders.md.md @@ -0,0 +1,91 @@ +# HashAlgorithmProviders + +Namespace: SimpleOTP + +Provides methods for registering and retrieving providers. + +```csharp +public static class HashAlgorithmProviders +``` + +Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [HashAlgorithmProviders](simpleotp.hashalgorithmproviders)
+Attributes [NullableContextAttribute](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.nullablecontextattribute), [NullableAttribute](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.nullableattribute) + +## Methods + +### **AddProvider(OtpAlgorithm, KeyedHashAlgorithm)** + +Registers a new provider. + +```csharp +public static void AddProvider(OtpAlgorithm algorithm, KeyedHashAlgorithm algorithmProvider) +``` + +#### Parameters + +`algorithm` [OtpAlgorithm](simpleotp.otpalgorithm)
+The algorithm to register. + +`algorithmProvider` KeyedHashAlgorithm
+The provider to register. + +### **GetProvider(OtpAlgorithm)** + +Retrieves a provider. + +```csharp +public static KeyedHashAlgorithm GetProvider(OtpAlgorithm algorithm) +``` + +#### Parameters + +`algorithm` [OtpAlgorithm](simpleotp.otpalgorithm)
+The algorithm to retrieve. + +#### Returns + +KeyedHashAlgorithm
+The provider, or `null` if not found. + +### **RemoveProvider(OtpAlgorithm)** + +Removes a provider. + +```csharp +public static void RemoveProvider(OtpAlgorithm algorithm) +``` + +#### Parameters + +`algorithm` [OtpAlgorithm](simpleotp.otpalgorithm)
+The algorithm to remove. + +### **IsRegistered(OtpAlgorithm)** + +Determines whether a provider is registered. + +```csharp +public static bool IsRegistered(OtpAlgorithm algorithm) +``` + +#### Parameters + +`algorithm` [OtpAlgorithm](simpleotp.otpalgorithm)
+The algorithm to check. + +#### Returns + +[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
+`true` if the provider is registered; otherwise, `false`. + +### **ClearProviders()** + +Removes all registered providers. + +```csharp +public static void ClearProviders() +``` + +**Remarks:** + +This method also clears default providers. Use with caution.