Documentation

Hale.Http2.Network.HTTP2.HPACK.Encode

Encode an integer with the given prefix size (1-8 bits). The first byte has 8 - prefixBits high bits already set by the caller.

$$I < 2^N - 1 \Rightarrow \text{one byte: } I$$ $$I \geq 2^N - 1 \Rightarrow \text{prefix } 2^N - 1, \text{ then } I - (2^N-1) \text{ in 7-bit chunks}$$

$$\text{encodeInteger} : \text{Nat} \to \text{Nat} \to \text{ByteArray}$$

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Equations
    Instances For

      Encode a string literal in HPACK format. The first byte's high bit indicates Huffman coding (0 = raw).

      $$\text{encodeString} : \text{String} \to \text{ByteArray}$$

      Equations
      Instances For

        HPACK header representation types.

        • indexed (index : Nat) : HeaderRep

          Indexed Header Field Representation (Section 6.1). References a complete (name, value) pair from the table.

        • literalIndexed (nameIndex : Option Nat) (name value : String) : HeaderRep

          Literal Header Field with Incremental Indexing (Section 6.2.1). The field is added to the dynamic table.

        • literalNotIndexed (nameIndex : Option Nat) (name value : String) : HeaderRep

          Literal Header Field without Indexing (Section 6.2.2). The field is NOT added to the dynamic table.

        • literalNeverIndexed (nameIndex : Option Nat) (name value : String) : HeaderRep

          Literal Header Field Never Indexed (Section 6.2.3). Sensitive value that must never be indexed.

        • tableSizeUpdate (newSize : Nat) : HeaderRep

          Dynamic Table Size Update (Section 6.3).

        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Encode a list of header fields using HPACK. Uses incremental indexing for all fields (the simplest strategy). Returns the encoded header block and the updated dynamic table.

            $$\text{encodeHeaders} : \text{DynamicTable} \to \text{List}(\text{HeaderField}) \to \text{ByteArray} \times \text{DynamicTable}$$

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For