Class FileInfoExtensions
IO-related extension methods for
Inheritance
System.Object
FileInfoExtensions
Namespace: X10D.IO
Assembly: X10D.dll
Syntax
public static class FileInfoExtensions : object
Methods
| Improve this Doc View SourceGetHash<T>(FileInfo)
Computes the hash of a file using the specified hash algorithm.
Declaration
public static byte[] GetHash<T>(this FileInfo value)
where T : HashAlgorithm
Parameters
Type | Name | Description |
---|---|---|
FileInfo | value | The file whose hash to compute. |
Returns
Type | Description |
---|---|
System.Byte[] | The hash of |
Type Parameters
Name | Description |
---|---|
T | The type of the |
TryWriteHash<T>(FileInfo, Span<Byte>, out Int32)
Computes the hash of a file using the specified hash algorithm.
Declaration
public static bool TryWriteHash<T>(this FileInfo value, Span<byte> destination, out int bytesWritten)
where T : HashAlgorithm
Parameters
Type | Name | Description |
---|---|---|
FileInfo | value | The file whose hash to compute. |
Span<System.Byte> | destination | When this method returns, contains the computed hash of |
System.Int32 | bytesWritten | When this method returns, the total number of bytes written into destination. This parameter is treated as uninitialized. |
Returns
Type | Description |
---|---|
System.Boolean | true if the destination is long enough to receive the hash; otherwise, false. |
Type Parameters
Name | Description |
---|---|
T | The type of the |