Companion

object Companion

Functions

Link copied to clipboard
fun of(value: Entry, publicKey: ByteArray, seq: Long, salt: ByteArray = DhtItems.EMPTY): MutableItem

Build an unsigned mutable item from an editable value. Call sign before sending. Mirrors libtorrent constructing an item then assign-ing.

Link copied to clipboard
fun received(value: BdecodeNode, publicKey: ByteArray, seq: Long, signature: ByteArray, salt: ByteArray = DhtItems.EMPTY): MutableItem?

Rebuild a mutable item received over the wire, verifying its signature. This ports bool item::assign(bdecode_node const& v, salt, seq, pk, sig), which returns false (here: null) when verification fails.