ContentHash

References
Contains information that is useful to uniquely identify an object. This object is immutable.

Constructors

ContentHash

#
Constructs a copy of a content hash.
protected ContentHash(
ContentHash
other
The other content hash to copy.
)

Properties

ByteCount

#Since v6.0
Gets the length of the content, in bytes.
[CLSCompliant(false)] public ulong ByteCount { get; }

HashTime

#Since v6.0
Gets the hash time, rounded to seconds.
public DateTime HashTime { get; }

Sha1ContentHash

#Since v6.0
Gets the 20-bytes long SHA1 hash of the content.
public byte[] Sha1ContentHash { get; }

Sha1NameHash

#Since v6.0
Gets the 20-bytes long SHA1 hash of the name.
public byte[] Sha1NameHash { get; }

Methods

Clone

#Since v6.0
Creates a copy of this content hash. Because content hash is immutable, this can be used as a deep copy.
public ContentHash Clone()
A different instance of the same content hash.

CreateFromFile

#Since v6.0
Creates a new ContentHash, representing the content of a file.
public static ContentHash CreateFromFile(
path
A path. This can be null and can refer to a non-existing path.
)

Equals

#Since v6.0
Determines if another content hash has the same value.
public bool Equals(
other
The other content hash to compare.
)
True if the two hashes are equal.

Equals

#
Determines if another object is a content hash with same value.
public override bool Equals(
obj
The other content hash to compare.
)
True if the two hashes are equal.
Object.Equals

GetHashCode

#
Gets an hash code for this content hash. Two equal content hashes have equal hash code. The other way around might not be true.
public override int GetHashCode()
An hash code value.
Explicit

ICloneable.Clone

#Since v6.0

Operators

OperationResultDescription
ContentHash==ContentHashboolDetermines if two ContentHash instances are equal by value.
ContentHash!=ContentHashboolDetermines if two ContentHash instances are different by value.