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