Add Meta authentication secret and SHA256 hashing

This commit is contained in:
Holden
2026-06-21 15:36:17 -05:00
parent e77e479493
commit 706c4f13d8
7 changed files with 242 additions and 8 deletions

View File

@@ -0,0 +1,19 @@
using System.Security.Cryptography;
using System.Text;
namespace RecNet.Application.Common.Security;
public static class Hashing
{
public static byte[] ComputeSha256(string input)
=> SHA256.HashData(Encoding.UTF8.GetBytes(input));
public static bool VerifySha256(string input, byte[] expectedHash)
{
var computedHash = ComputeSha256(input);
return CryptographicOperations.FixedTimeEquals(
computedHash,
expectedHash);
}
}