Static ReadonlyBUFFER_Pause sending above this many buffered bytes.
Static ReadonlyBUFFER_Resume sending below this many buffered bytes.
Static ReadonlyCHUNK_Bytes used for the chunk index prefix inside the plaintext.
Static ReadonlyCONNECT_Timeout for establishing the peer connection after pairing.
Static ReadonlyCONTROL_Timeout for awaited control messages (meta/accept/complete).
Static ReadonlyMAX_Hard cap for a single data-channel message (cross-implementation safe).
Static ReadonlyNACK_How often a single chunk may be re-requested before aborting.
StaticchunkTotal chunks for a file size.
The file size in bytes.
The payload size of a single chunk.
The number of chunks.
StaticchunkUsable payload bytes per chunk for a given negotiated SCTP max message size.
OptionalsctpMaxMessageSize: number | nullThe negotiated maximum, or null when unknown.
The plaintext payload size of a single chunk.
StaticdecryptStaticdecryptDecrypt a string frame into a control message.
The frame to decrypt.
The transfer key.
The control message.
StaticencryptEncrypt a chunk into a binary frame.
The absolute chunk index.
The plaintext chunk payload.
The transfer key.
The encrypted binary frame.
StaticencryptEncrypt a control message into a string frame.
The message to encrypt.
The transfer key.
The encrypted string frame.
Framing, chunk math, and encryption helpers for the P2P wire protocol. String frames carry P2PControlMessages, binary frames carry chunks whose plaintext is
[4-byte big-endian chunk index][payload].