Class Hashes
Inheritance
System.Object
Hashes
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: MonoTorrent
Assembly: MonoTorrent.dll
Syntax
public class Hashes
Properties
Count
Number of Hashes (equivalent to number of Pieces)
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
IsValid(Byte[], Int32)
Determine whether a calculated hash is equal to our stored hash
Declaration
public bool IsValid(byte[] hash, int hashIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | hash | Hash code to check |
| System.Int32 | hashIndex | Index of hash/piece to verify against |
Returns
| Type | Description |
|---|---|
| System.Boolean | true iff hash is equal to our stored hash, false otherwise |
ReadHash(Int32)
Returns the hash for a specific piece
Declaration
public byte[] ReadHash(int hashIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | hashIndex | Piece/hash index to return |
Returns
| Type | Description |
|---|---|
| System.Byte[] | byte[] (length HashCodeLength) containing hashdata |