Ejemplo n.º 1
0
 public static string ToHashString(this string str, HashAlgorithm algorithm)
 {
     if (str == null)
     {
         return(null);
     }
     return(ToString(algorithm.ComputeHash(Encoding.GetBytes(str))));
 }
Ejemplo n.º 2
0
 public static string ToHashString(this byte[] buffer, int offset, int count, HashAlgorithm algorithm)
 {
     if (buffer == null)
     {
         return(null);
     }
     return(ToString(algorithm.ComputeHash(buffer, offset, count)));
 }
Ejemplo n.º 3
0
 public static string ToHashString(this Stream inputStream, HashAlgorithm algorithm)
 {
     if (inputStream == null)
     {
         return(null);
     }
     return(ToString(algorithm.ComputeHash(inputStream)));
 }
Ejemplo n.º 4
0
 public static string ToHashString(this byte[] buffer, HashAlgorithm algorithm)
 {
     if (buffer == null)
     {
         return(null);
     }
     return(ToString(algorithm.ComputeHash(buffer)));
 }