using System.Security.Cryptography; namespace EngineeringSync.Service.Services; public static class FileHasher { public static async Task ComputeAsync(string filePath, CancellationToken ct = default) { await using var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 4096, true); var hash = await SHA256.HashDataAsync(stream, ct); return Convert.ToHexString(hash); } }