effusion v0.2.0 Effusion.DHT View Source

Documentation for Effusion.DHT.

Link to this section Summary

Functions

Calcuates the distance between two node IDs. Smaller values mean the two nodes are closer.

Generates twenty-byte node ID.

Generates a token for use in get_peers responses.

Generates a unique ID for transactions.

Link to this section Functions

Calcuates the distance between two node IDs. Smaller values mean the two nodes are closer.

This function uses the Kademlia distance metric: XOR.

## Examples

  iex> Effusion.DHT.distance("12345678901234567890", "12345678901234567890")
  0

  iex> Effusion.DHT.distance("12345678901234567890", "09876543210987654321")
  5955258228003349104393039705260020053666630401
Link to this macro

is_inet_port(n)

View Source (macro)
Link to this macro

is_info_hash(binary)

View Source (macro)
Link to this macro

is_node_id(binary)

View Source (macro)

Generates twenty-byte node ID.

Generates a token for use in get_peers responses.

Generates a unique ID for transactions.