Method | Description | |
---|---|---|
CompareTo ( object obj ) : int |
Compare ourselves to an object
|
|
DifferingBit ( |
Determines the least significant bit at which the given ID differs from this one, from 0 through 8 * ID_LENGTH - 1. PRECONDITION: IDs do not match.
|
|
Equals ( object obj ) : bool |
Method used to verify if two objects are equals.
|
|
FromString ( string hash ) : |
Method that generates an ID starting from a generic string. This is not hashing.
|
|
GetHashCode ( ) : int |
Method used to get the hash code according to the algorithm: http://stackoverflow.com/questions/16340/how-do-i-generate-a-hashcode-from-a-byte-array-in-c/425184#425184
|
|
Hash ( string key ) : |
Hash a string to produce an ID
|
|
HostID ( ) : |
Get an ID that will be the same between different calls on the same machine by the same app run by the same user. If that ID is taken, returns a random ID.
|
|
ID ( byte data ) : System |
Make a new ID from a byte array.
|
|
ID ( string new_id ) : System |
Make a new ID starting from a string. Pay attention, the string is not hashed, it is simply translated to an ID object.
|
|
RandomID ( ) : |
Produce a random ID.
|
|
RandomizeBeyond ( int bit ) : |
Return a copy of ourselves that differs from us at the given bit and is random beyond that.
|
|
ToPathString ( ) : string |
Returns this ID represented as a path-safe string.
|
|
ToString ( ) : string |
Turn this ID into a string.
|
|
operator ( ) : |
XOR operator. This is our distance metric in the DHT.
|
|
operator ( ) : bool |
We need to compare these when measuring distance
|
Method | Description | |
---|---|---|
FlipBit ( byte data, int bit ) : void |
Flips the given bit in the byte array. Byte array must be ID_LENGTH long.
|
|
IDInit ( byte data ) : void |
This method initialize an id starting from a byte array.
|
public CompareTo ( object obj ) : int | ||
obj | object | An obect to compare to |
return | int |
public DifferingBit ( |
||
other | The ID to compare to | |
return | int |
public Equals ( object obj ) : bool | ||
obj | object | The object to compare to |
return | bool |
public static FromString ( string hash ) : |
||
hash | string | The hash string originating an ID |
return |
public static Hash ( string key ) : |
||
key | string | Key string to convert |
return |
public ID ( byte data ) : System | ||
data | byte | An array of exactly 20 bytes. |
return | System |
public ID ( string new_id ) : System | ||
new_id | string | The string to translate |
return | System |
public RandomizeBeyond ( int bit ) : |
||
bit | int | the bit to start to launch random bits |
return |