/// <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)); }
/// <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)); }
/// <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)); }
/// <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())); }