wasSharpNET – Diff between revs 13 and 14
?pathlinks?
Rev 13 | Rev 14 | |||
---|---|---|---|---|
Line 36... | Line 36... | |||
36 | /// <summary> |
36 | /// <summary> |
|
37 | /// Return a 40 character hex representation of a SHA1 hash. |
37 | /// Return a 40 character hex representation of a SHA1 hash. |
|
38 | /// </summary> |
38 | /// </summary> |
|
39 | /// <param name="sha1">the SHA1 hash object</param> |
39 | /// <param name="sha1">the SHA1 hash object</param> |
|
40 | /// <param name="data">the memorystream to compute the hash from</param> |
40 | /// <param name="data">the memorystream to compute the hash from</param> |
|
- | 41 | public static string ToHex(this System.Security.Cryptography.SHA1 sha1, Stream data) |
||
- | 42 | { |
||
- | 43 | return BitConverter.ToString(sha1.ComputeHash(data)).Replace("-", ""); |
||
- | 44 | } |
||
- | 45 | |
||
- | 46 | /// <summary> |
||
- | 47 | /// Return a 40 character hex representation of a SHA1 hash. |
||
- | 48 | /// </summary> |
||
- | 49 | /// <param name="sha1">the SHA1 hash object</param> |
||
- | 50 | /// <param name="data">a filestream to read the file from</param> |
||
41 | public static string ToHex(this System.Security.Cryptography.SHA1 sha1, MemoryStream data) |
51 | public static string ToHex(this System.Security.Cryptography.SHA1 sha1, FileStream data) |
|
42 | { |
52 | { |
|
43 | return BitConverter.ToString(sha1.ComputeHash(data)).Replace("-", ""); |
53 | return BitConverter.ToString(sha1.ComputeHash(data)).Replace("-", ""); |
|
44 | } |
54 | } |
|
Line 45... | Line 55... | |||
45 | |
55 | |