Esempio n. 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));
 }
Esempio n. 2
0
 /// <summary>
 /// 將串流使用指定的雜湊演算法轉換為雜湊
 /// </summary>
 /// <typeparam name="Algorithm">雜湊演算法型別</typeparam>
 /// <param name="stream">串流實例</param>
 /// <returns>雜湊Binary</returns>
 public static byte[] ToHash <Algorithm>(this Stream stream) where Algorithm : HashAlgorithm
 {
     return(HashUtility.ToHash <Algorithm>(stream));
 }
Esempio n. 3
0
 /// <summary>
 /// 將Byte陣列使用指定的雜湊演算法轉換為雜湊
 /// </summary>
 /// <typeparam name="Algorithm">雜湊演算法型別</typeparam>
 /// <param name="binary">Byte陣列</param>
 /// <returns>雜湊Binary</returns>
 public static byte[] ToHash <Algorithm>(this byte[] binary) where Algorithm : HashAlgorithm
 {
     return(HashUtility.ToHash <Algorithm>(binary));
 }
Esempio n. 4
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));
 }
Esempio n. 5
0
 /// <summary>
 /// 將字串使用指定的雜湊演算法轉換為雜湊
 /// </summary>
 /// <typeparam name="Algorithm">雜湊演算法型別</typeparam>
 /// <param name="str">字串</param>
 /// <returns>雜湊Binary</returns>
 public static byte[] ToHash <Algorithm>(this string str) where Algorithm : HashAlgorithm
 {
     return(HashUtility.ToHash <Algorithm>(str));
 }