mirror of
https://github.com/XFox111/SimpleOTP.git
synced 2026-04-22 08:00:45 +03:00
1b989e7b35
* New 2.0 version + DependencyInjection library * Updated docs and repo settings (devcontainers, vscode, github, etc.) * Added tests * Fixed bugs * Minor test project refactoring * Updated projects - Added symbol packages - Updated package versions to pre-release * Updated SECURITY.md * Added GitHub Actions workflows
27 lines
896 B
C#
27 lines
896 B
C#
namespace SimpleOTP.Encoding;
|
|
|
|
/// <summary>
|
|
/// Provides methods for encoding and decoding data using the RFC 4648 Base32 "Extended Hex" alphabet.
|
|
/// </summary>
|
|
public interface IEncoder
|
|
{
|
|
/// <summary>
|
|
/// Gets the encoding scheme used by the encoder (e.g. <c>base32</c> or <c>base32hex</c>).
|
|
/// </summary>
|
|
public string Scheme { get; }
|
|
|
|
/// <summary>
|
|
/// Converts a byte array to a Base32 string representation.
|
|
/// </summary>
|
|
/// <param name="data">The byte array to convert.</param>
|
|
/// <returns>The Base32 string representation of the byte array.</returns>
|
|
public string EncodeBytes(byte[] data);
|
|
|
|
/// <summary>
|
|
/// Converts a Base32 encoded string to a byte array.
|
|
/// </summary>
|
|
/// <param name="data">The Base32 encoded string to convert.</param>
|
|
/// <returns>The byte array representation of the Base32 encoded string.</returns>
|
|
public byte[] GetBytes(string data);
|
|
}
|