1
0
mirror of https://github.com/XFox111/SimpleOTP.git synced 2026-04-22 08:00:45 +03:00

Created simpleotp.hashalgorithmproviders.md (markdown)

Eugene Fox
2024-09-18 16:13:30 +03:00
parent 31aa719a07
commit 6d1548b333
+91
@@ -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)<br>
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)<br>
The algorithm to register.
`algorithmProvider` KeyedHashAlgorithm<br>
The provider to register.
### **GetProvider(OtpAlgorithm)**
Retrieves a provider.
```csharp
public static KeyedHashAlgorithm GetProvider(OtpAlgorithm algorithm)
```
#### Parameters
`algorithm` [OtpAlgorithm](simpleotp.otpalgorithm)<br>
The algorithm to retrieve.
#### Returns
KeyedHashAlgorithm<br>
The provider, or `null` if not found.
### **RemoveProvider(OtpAlgorithm)**
Removes a provider.
```csharp
public static void RemoveProvider(OtpAlgorithm algorithm)
```
#### Parameters
`algorithm` [OtpAlgorithm](simpleotp.otpalgorithm)<br>
The algorithm to remove.
### **IsRegistered(OtpAlgorithm)**
Determines whether a provider is registered.
```csharp
public static bool IsRegistered(OtpAlgorithm algorithm)
```
#### Parameters
`algorithm` [OtpAlgorithm](simpleotp.otpalgorithm)<br>
The algorithm to check.
#### Returns
[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
`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.