Module

whiplash/hpack/tables

src/whiplash/hpack/tables.pooka

HPACK's fixed tables: the static table and the Huffman code.

API reference

function

static_entry

src/whiplash/hpack/tables.pooka:9
static_entry(index: Int) -> Option(#(String, String))
INFERREDfn(Int) -> Option(#(String, String))

The static table entry at index, from 1 to 61.

function

static_field

src/whiplash/hpack/tables.pooka:77
static_field(name: String, value: String) -> Int
INFERREDfn(String, String) -> Int

The static index of a whole field, or 0.

function

static_name

src/whiplash/hpack/tables.pooka:98
static_name(name: String) -> Int
INFERREDfn(String) -> Int

The first static index with this name, or 0.

function

huffman_code

src/whiplash/hpack/tables.pooka:157
huffman_code(byte: Int) -> #(Int, Int)
INFERREDfn(Int) -> #(Int, Int)

The Huffman code of a byte, and its length in bits.

function

huffman_step

src/whiplash/hpack/tables.pooka:423
huffman_step(state: Int, nibble: Int) -> #(Int, Int, Bool)
INFERREDfn(Int, Int) -> #(Int, Int, Bool)

One step of the decoder: four bits from state. The result is the next state, the byte completed plus one (0 for none), and whether the input may end there. Decoding EOS gives a next state of -1. Every result is a constant tuple, so a step allocates nothing.