Incremental hasher.
See Also: Inherited members from object.
|
Finalize
()Called by garbage collector to free native resources. |
|
|
Finish
()Finishes calculation of hashes. |
|
static
|
GetHashForFile
(string, HashType)Computes message digest for given file. |
|
static
|
GetHashForMsg
(byte[], HashType)Computes message digest for given binary message. |
|
|
GetMagnet
(string)Generates magnet link with given filename. |
|
|
GetMagnet
(string, uint)Generates magnet link with given filename and hashes. |
|
static
|
GetMagnetFor
(string, uint)Generates magnet for specified file with given hashes. |
|
|
Reset
()Resets this Hasher to initial state. |
|
|
ToBase32
(HashType)Returns value of computed digest as base32 string. |
|
|
ToBase64
(HashType)Returns value of computed digest as base64 string. |
|
|
ToHex
(HashType)Returns value of computed digest as hexadecimal string. |
|
|
ToRaw
(HashType)Returns value of computed digest as raw bytes encoded in ANSI string. |
|
override
|
ToString
()Returns value of computed digest as string in default format. |
|
|
ToString
(HashType)Returns value of computed digest as string in default format. |
|
|
Update
(byte[])Updates this Hasher with new data chunk. |
|
|
Update
(byte[], int)Updates this Hasher with new data chunk. |
|
|
UpdateFile
(string)Updates this Hasher with data from given file. |
Creates new Hasher to compute message digest for given type.
Syntax
public Hasher (HashType hashtype)Parameters
- hashtype
- Type of hashing algorithm.
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Creates new Hasher to compute message digests for given set of hashing algorithms.
Syntax
public Hasher (uint hashmask)Parameters
- hashmask
- Mask created of one or more RHash.HashType values.
Exceptions
Type Reason ArgumentException Argument is zero or contains invalid bits. Remarks
Mask should be created from ORed HashType values. The next example will create Hasher that computes both CRC32 and MD5 sums:
C# Example new Hasher((uint)HashType.CRC32 | (uint)HashType.MD5);Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Called by garbage collector to free native resources.
Syntax
void Finalize ()Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Finishes calculation of hashes.
Syntax
public void Finish ()Remarks
Processes any buffered data and finishes computation of hash sums.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Computes message digest for given file.
Syntax
Parameters
- filename
- File to compute hash for.
- type
- Type of hash to compute.
Returns
Message digest as returned by Hasher.ToString(HashType).Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Computes message digest for given binary message.
Syntax
Parameters
- buf
- Binary message to compute hash for.
- type
- Type of hash to compute.
Returns
Message digest, as returned by Hasher.ToString(HashType).Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Generates magnet link with given filename.
Syntax
Parameters
- filepath
- File path to be included in magnet. May be null.
Returns
Magnet link.Remarks
Magnet includes all hashes computed by this hasher. If filepath is null then returned magnet does not contain a filename.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Generates magnet link with given filename and hashes.
Syntax
Parameters
- filepath
- File path to be included in magnet. May be null.
- hashmask
- Mask created from one or more RHash.HashType values.
Returns
Magnet link.Remarks
Only hashes that were computed by this Hasher are included in the output. If filepath is null then returned magnet does not contain a filename.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Generates magnet for specified file with given hashes.
Syntax
Parameters
- filepath
- File to process.
- hashmask
- Mask created of one or more RHash.HashType values.
Returns
Magnet link.Remarks
Returned magnet includes file name and all computed hashes.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Resets this Hasher to initial state.
Syntax
public void Reset ()Remarks
The Hasher becomes available to process new data chunks. Note, that this method returns Hasher to the state after creating the object, NOT the state when hashing continues. Therefore, all previously calculated hashes are lost and process starts from the very beginning.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Returns value of computed digest as base32 string.
Syntax
Parameters
- type
- Type of hashing algorithm.
Returns
Message digest in form of base32 string.Exceptions
Type Reason ArgumentException This Hasher does not compute hash of given type. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Returns value of computed digest as base64 string.
Syntax
Parameters
- type
- Type of hashing algorithm.
Returns
Message digest in form of base64 string.Exceptions
Type Reason ArgumentException This Hasher does not compute hash of given type. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Returns value of computed digest as hexadecimal string.
Syntax
Parameters
- type
- Type of hashing algorithm.
Returns
Message digest in form of hexadecimal string.Exceptions
Type Reason ArgumentException This Hasher does not compute hash of given type. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Returns value of computed digest as raw bytes encoded in ANSI string.
Syntax
Parameters
- type
- Type of hashing algorithm.
Returns
Message digest as raw bytes encoded in an ANSI string.Exceptions
Type Reason ArgumentException This Hasher does not compute hash of given type. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Returns value of computed digest as string in default format.
Syntax
public override string ToString ()Returns
Message digest as string.Remarks
For Hasher created using Hasher(HashType) constructor, this method returns the same string as Hasher.ToString(HashType) method with the hash type used in constructor.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Returns value of computed digest as string in default format.
Syntax
Parameters
- type
- Type of hashing algorithm.
Returns
Message digest for given hashing algorithm.Exceptions
Type Reason ArgumentException This Hasher does not compute hash of given type. Remarks
If default output for hashing algorithm is base32 then returned value is the same as if Hasher.ToBase32(HashType) method was called; otherwise value is the same as returned by Hasher.ToHex(HashType) method.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Updates this Hasher with new data chunk.
Syntax
Parameters
- buf
- Data for hashing.
Returns
This hasher.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Updates this Hasher with new data chunk.
Syntax
Parameters
- buf
- Data for hashing.
- len
- Number of bytes in array to hash.
Returns
This Hasher.Exceptions
Type Reason IndexOutOfRangeException Argument len is negative or greater than buffer length. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1
Updates this Hasher with data from given file.
Syntax
Parameters
- filename
- Name of the file to process.
Returns
This Hasher.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: RHash
Assembly: RHash (in RHash.dll)
Assembly Versions: 1.0.1.1