Constructors
Fields
Properties
Methods
CreateFromBytes
#Create a hash from a byte array.
Parameters:
| bytes (byte[]) | Bytes to hash. |
Returns: Hash.
CreateFromCollection
#Create a hash from a byte array.
Parameters:
| data (IEnumerable<byte>) | Array to hash. |
Returns: Hash.
CreateFromCollection
#Create a hash from a double array.
Parameters:
| data (IEnumerable<double>) | Array to hash. |
Returns: Hash.
CreateFromCollection
#Create a hash from a float array.
Parameters:
| data (IEnumerable<float>) | Array to hash. |
Returns: Hash.
CreateFromCollection
#Create a hash from an integer array.
Parameters:
| data (IEnumerable<int>) | Array to hash. |
Returns: Hash.
CreateFromCollection
#Create a hash from an integer array.
Parameters:
| data (IEnumerable<long>) | Array to hash. |
Returns: Hash.
CreateFromDelegate<T>
#Create a hash from a collection and a hasher function.
Parameters:
| data (IEnumerable<T>) | Items to include in hash. |
| mapping (Func<T, byte[]>) | Mapping function for converting T instances into byte arrays. |
Returns: Hash.
CreateFromFile
#Create a hash from the contents of a path.
Parameters:
| path (string) | File path. |
Returns: Hash for file contents, ignoring the directory and name of the file.
CreateFromObjects
#Use the GetHashCode() method on each object for a composite hash.
Parameters:
| elements (params object[]) | Elements to hash, array may contain null items. |
Returns: Composite hash.
CreateFromStream
#Create a hash from the contents of a stream.
Parameters:
| stream (Stream) | Stream to hash. The stream position will not be set to zero, and will end up at the end of the stream. It is the responsibility of the caller to ensure the position in in the desired place and then properly restored afterwards. |
Returns: Hash.
Equals
#Test equality between this hash and another object.
Parameters:
| obj (object) | Other hash. |
Overrides: Object.Equals
Store
#Write this hash to an archive. This is not typically advised as hashing algorithms may change at any moment. Hashes should be recomputed anew during each appdomain session.
Parameters:
| other (Hash) |
ToString
#Convert this hash to a string.
Parameters:
| format (HashFormat) | Format for encoding. |
Returns: A string representing the hash.
Operators
| Operation | Result | Description | ||
|---|---|---|---|---|
| Hash | & | Hash | Hash | Apply logical conjunction on two hashes. |
| Hash | | | Hash | Hash | Apply logical disjunction on two hashes. |
| Hash | == | Hash | bool | Test two hashes for equality. |
| Hash | ^ | Hash | Hash | Apply a bitwise exclusive or to two hashes. |
| Hash | != | Hash | bool | Test two hashes for inequality. |
| ~ | Hash | Hash | Apply a bitwise complement on a hash. | |