Table of Contents

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

FilePath string

The absolute path to the file that was hashed, or null if hashed from a stream.

Hash string

The computed hash as a lowercase hexadecimal string.

Algorithm HashAlgorithm

The algorithm used to compute the hash.

FileSize long

The size of the data that was hashed in bytes. Returns -1 for non-seekable streams.

ComputationTime TimeSpan

The time taken to compute the hash.

Properties

Algorithm

The algorithm used to compute the hash.

public HashAlgorithm Algorithm { get; init; }

Property Value

HashAlgorithm

ComputationTime

The time taken to compute the hash.

public TimeSpan ComputationTime { get; init; }

Property Value

TimeSpan

FilePath

The absolute path to the file that was hashed, or null if hashed from a stream.

public string? FilePath { get; init; }

Property Value

string

FileSize

The size of the data that was hashed in bytes. Returns -1 for non-seekable streams.

public long FileSize { get; init; }

Property Value

long

Hash

The computed hash as a lowercase hexadecimal string.

public string Hash { get; init; }

Property Value

string