Hashes

data class Hashes(val piecesRoot: ByteArray, val baseLayer: Int, val index: Int, val length: Int, val proofLayers: Int, val hashes: List<ByteArray>) : PeerMessage

hashes (id 22, BEP-52): the response to a HashRequest, carrying the requested range of 32-byte SHA-256 Merkle hashes. The payload is the same 48-byte header as HashRequest followed by N concatenated 32-byte hashes. On the wire: [len=49+32*N][22][header][hash...]. Mirrors write_hashes / on_hashes.

Constructors

Link copied to clipboard
constructor(piecesRoot: ByteArray, baseLayer: Int, index: Int, length: Int, proofLayers: Int, hashes: List<ByteArray>)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val id: Int

The numeric message id, or -1 for KeepAlive (which has no id byte on the wire). Matches bt_peer_connection::message_type.

Link copied to clipboard
val index: Int
Link copied to clipboard
val length: Int
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun encode(): ByteArray

The full on-the-wire frame: 4-byte big-endian length prefix + id + payload.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String