Hasher.cs 348 B

1234567891011121314
  1. using System.Linq;
  2. using System.Security.Cryptography;
  3. namespace BeatLyrics.Tool.Utils
  4. {
  5. internal static class Hasher
  6. {
  7. public static string Sha1Hex(byte[] toHash)
  8. {
  9. using var sha1 = new SHA1Cng();
  10. return string.Join("", sha1.ComputeHash(toHash).Select(p => p.ToString("x2")));
  11. }
  12. }
  13. }