Beispiel #1
0
 /// <summary>
 /// 將串流使用指定的雜湊演算法轉換為雜湊後在轉換為16進位字串表示
 /// </summary>
 /// <typeparam name="Algorithm">雜湊演算法型別</typeparam>
 /// <param name="stream">串流實例</param>
 /// <param name="upper">是否轉換為大寫</param>
 /// <returns>雜湊字串</returns>
 public static string ToHashString <Algorithm>(this Stream stream, bool upper = true) where Algorithm : HashAlgorithm
 {
     return(HashUtility.ToHashString <Algorithm>(stream, upper));
 }
Beispiel #2
0
 /// <summary>
 /// 將Byte陣列使用指定的雜湊演算法轉換為雜湊後在轉換為16進位字串表示
 /// </summary>
 /// <typeparam name="Algorithm">雜湊演算法型別</typeparam>
 /// <param name="binary">Byte陣列</param>
 /// <param name="upper">是否轉換為大寫</param>
 /// <returns>雜湊字串</returns>
 public static string ToHashString <Algorithm>(this byte[] binary, bool upper = true) where Algorithm : HashAlgorithm
 {
     return(HashUtility.ToHashString <Algorithm>(binary, upper));
 }