DhtItem

sealed class DhtItem

A DHT data item, the port of class dht::item (item.cpp, item.hpp). An item is either immutable (target = SHA-1 of the bencoded value, BEP-44 §"Immutable items") or mutable (target = SHA-1(public key + salt), signed by an ed25519 key, BEP-44 §"Mutable items").

libtorrent's item carries an owning entry m_value; here the value is held both as a parsed Entry (value) and as its canonical bencoding (bencodedValue), because the bencoding is what feeds the target hash and the signature and must be byte-stable. Use ImmutableItem / MutableItem rather than constructing this directly.

Inheritors

Properties

Link copied to clipboard
abstract val bencodedValue: ByteArray

The exact bencoding of value: the bytes that travel as a["v"].

Link copied to clipboard
abstract val isMutable: Boolean

True for a BEP-44 mutable (signed) item.

Link copied to clipboard
abstract val target: Sha1Hash

The DHT key this item is stored under.

Link copied to clipboard
abstract val value: Entry

The item's value as an editable Entry.