1
0
mirror of https://github.com/XFox111/SimpleOTP.git synced 2026-04-22 08:00:45 +03:00
Files
SimpleOTP/libraries/SimpleOTP/Encoding/IEncoder.cs
T
xfox111 1b989e7b35 Major 2.0 (#20)
* 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
2024-09-26 03:20:30 +03:00

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);
}