예제 #1
0
 /// <summary>
 /// Calculate an SHA256 hash from a stream
 /// </summary>
 /// <param name="s"></param>
 /// <returns></returns>
 public static SHA256Hash SHA256(this Stream s)
 {
     return(SHA256Hash.FromStream(s));
 }
예제 #2
0
 /// <summary>
 /// Calculate an SHA256 hash of the file referenced by the FileInfo object
 /// </summary>
 /// <param name="fileInfoObject">The file to calculate</param>
 /// <returns></returns>
 public static SHA256Hash SHA256(this FileInfo fileInfoObject)
 {
     return(SHA256Hash.FromFile(fileInfoObject.FullName));
 }
예제 #3
0
 /// <summary>
 /// Calculate an SHA256 hash from a byte array
 /// </summary>
 /// <param name="b">Byte array to calculate</param>
 /// <returns></returns>
 public static SHA256Hash SHA256(this byte[] b)
 {
     return(SHA256Hash.FromMemory(b));
 }
예제 #4
0
 /// <summary>
 /// Calculate a SHA256 hash from a string
 /// </summary>
 /// <param name="stringToConvert">The string to calculate</param>
 /// <returns></returns>
 public static SHA256Hash SHA256(this String stringToConvert)
 {
     return(SHA256Hash.FromMemory(stringToConvert.ToByteArray()));
 }