-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1c0fb7
commit c756462
Showing
9 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// HashingHandler by Simon Field | ||
|
||
using System.Threading.Tasks; | ||
|
||
namespace HashingHandler; | ||
|
||
/// <summary> | ||
/// Interface for encoding <see cref="byte"/>[] to <see cref="string"/> asynchronously. | ||
/// </summary> | ||
public interface IStringEncodingAsync : IStringEncoding | ||
{ | ||
/// <summary> | ||
/// Converts a <see cref="byte"/>[] to a <see cref="string"/> asynchronously. | ||
/// </summary> | ||
/// <param name="bytes">The <see cref="byte"/>[] to convert to a <see cref="string"/>.</param> | ||
/// <returns>A <see cref="Task"/> representing the asynchronous operation that returns a <see cref="string"/> converted from the <see cref="byte"/>[].</returns> | ||
public Task<string> ConvertToStringAsync(byte[] bytes); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// HashingHandler by Simon Field | ||
|
||
using System.Threading.Tasks; | ||
|
||
namespace HashingHandler; | ||
|
||
/// <summary> | ||
/// Base class for encoding <see cref="byte"/>[] to <see cref="string"/>. | ||
/// </summary> | ||
public abstract class StringEncodingBase : IStringEncodingAsync | ||
{ | ||
public abstract string ConvertToString(byte[] bytes); | ||
|
||
public virtual Task<string> ConvertToStringAsync(byte[] bytes) => Task.Run(() => ConvertToString(bytes)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters