Class HashedFile
- Namespace
- CivitaiSharp.Tools.Hashing
- Assembly
- CivitaiSharp.Tools.dll
Result of a file hash computation containing the hash value and metadata.
public sealed record HashedFile : IEquatable<HashedFile>
- Inheritance
-
HashedFile
- Implements
- Inherited Members
Constructors
HashedFile(string?, string, HashAlgorithm, long, TimeSpan)
Result of a file hash computation containing the hash value and metadata.
public HashedFile(string? FilePath, string Hash, HashAlgorithm Algorithm, long FileSize, TimeSpan ComputationTime)
Parameters
FilePathstringThe absolute path to the file that was hashed, or null if hashed from a stream.
HashstringThe computed hash as a lowercase hexadecimal string.
AlgorithmHashAlgorithmThe algorithm used to compute the hash.
FileSizelongThe size of the data that was hashed in bytes. Returns -1 for non-seekable streams.
ComputationTimeTimeSpanThe time taken to compute the hash.
Properties
Algorithm
The algorithm used to compute the hash.
public HashAlgorithm Algorithm { get; init; }
Property Value
ComputationTime
The time taken to compute the hash.
public TimeSpan ComputationTime { get; init; }
Property Value
FilePath
The absolute path to the file that was hashed, or null if hashed from a stream.
public string? FilePath { get; init; }
Property Value
FileSize
The size of the data that was hashed in bytes. Returns -1 for non-seekable streams.
public long FileSize { get; init; }
Property Value
Hash
The computed hash as a lowercase hexadecimal string.
public string Hash { get; init; }