ContentHash
ReferencesContains information that is useful to uniquely identify an object. This object is immutable.
Constructors
ContentHash
#protected ContentHash(ContentHash other)
Constructs a copy of a content hash.
Parameters:
| other (ContentHash) | The other content hash to copy. |
Properties
Gets the length of the content, in bytes.
Gets the 20-bytes long SHA1 hash of the content.
Methods
Creates a copy of this content hash. Because content hash is immutable, this can be used as a deep copy.
Returns: A different instance of the same content hash.
Creates a new ContentHash, representing the content of a file.
Parameters:
| path (string) | A path. This can be null and can refer to a non-existing path. |
Determines if another content hash has the same value.
Parameters:
| other (ContentHash) | The other content hash to compare. |
Returns: True if the two hashes are equal.
Equals
#Determines if another object is a content hash with same value.
Parameters:
| obj (object) | The other content hash to compare. |
Returns: True if the two hashes are equal.
Overrides: 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.
Returns: An hash code value.
Overrides: Object.GetHashCode
Operators
| Operation | Result | Description | ||
|---|---|---|---|---|
| ContentHash | == | ContentHash | bool | Determines if two ContentHash instances are equal by value. |
| ContentHash | != | ContentHash | bool | Determines if two ContentHash instances are different by value. |