902942eee6
continuous-integration/drone/pr Build is passing
Sealed qualifying public classes Migrated database changes
14 lines
507 B
C#
14 lines
507 B
C#
namespace LiteCharms.Features.Extensions;
|
|
|
|
public static class Hash
|
|
{
|
|
public static readonly Func<string?, string?> StringToSha256Hash = (input) =>
|
|
Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(input!)));
|
|
|
|
public static readonly Func<Stream, string?> StreamToSha256Hash = (stream) =>
|
|
Convert.ToHexString(SHA256.HashData(stream));
|
|
|
|
public static readonly Func<byte[], string?> BytesToSha256Hash = (bytes) =>
|
|
Convert.ToHexString(SHA256.HashData(bytes));
|
|
}
|