forked from TheAlgorithms/C-Sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIEncoder.cs
25 lines (24 loc) · 907 Bytes
/
IEncoder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
namespace Algorithms.Encoders
{
/// <summary>
/// Encodes and decodes text based on specified key.
/// </summary>
/// <typeparam name="TKey">Type of the key.</typeparam>
public interface IEncoder<TKey>
{
/// <summary>
/// Encodes text using specified key.
/// </summary>
/// <param name="text">Text to be encoded.</param>
/// <param name="key">Key that will be used to encode the text.</param>
/// <returns>Encoded text.</returns>
string Encode(string text, TKey key);
/// <summary>
/// Decodes text that was encoded using specified key.
/// </summary>
/// <param name="text">Text to be decoded.</param>
/// <param name="key">Key that was used to encode the text.</param>
/// <returns>Decoded text.</returns>
string Decode(string text, TKey key);
}
}