ccf30ac36b
continuous-integration/drone/pr Build is passing
Implemented and tested DeleteFileAsync()
14 lines
480 B
C#
14 lines
480 B
C#
namespace LiteCharms.Features.Extensions;
|
|
|
|
public static class Hash
|
|
{
|
|
public static Func<string?, string?> StringToSha256Hash = (input) =>
|
|
Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(input!)));
|
|
|
|
public static Func<Stream, string?> StreamToSha256Hash = (stream) =>
|
|
Convert.ToHexString(SHA256.HashData(stream));
|
|
|
|
public static Func<byte[], string?> BytesToSha256Hash = (bytes) =>
|
|
Convert.ToHexString(SHA256.HashData(bytes));
|
|
}
|