1
0

HashCode.cs 569 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Text;
  3. using System.Security.Cryptography;
  4. namespace YOLODetectProcessLib
  5. {
  6. public class HashCode
  7. {
  8. public static string ComputeHashCode(byte[] input)
  9. {
  10. MD5 md5 = MD5.Create();
  11. byte[] hash = md5.ComputeHash(input);
  12. StringBuilder sb = new StringBuilder();
  13. foreach (var b in hash)
  14. {
  15. sb.Append(b.ToString("x2"));
  16. }
  17. string hashstr = sb.ToString();
  18. sb.Clear();
  19. return hashstr;
  20. }
  21. }
  22. }