hpack

HPACK for Crystal

An HPACK coder in Crystal.

Ported from loona-hpack (v0.4.3, commit b9b2f26), which was forked from hpack-rs.

Usage

require "hpack"

# Decoding
decoder = HPACK::Decoder.new
headers = decoder.decode(Bytes[0x82, 0x84])
headers.should eq([
  {Bytes[58, 109, 101, 116, 104, 111, 100], Bytes[71, 69, 84]},
  {Bytes[58, 112, 97, 116, 104], Bytes[47]},
])

# Encoding
encoder = HPACK::Encoder.new
encoded = encoder.encode([{Bytes[58, 109, 101, 116, 104, 111, 100], Bytes[71, 69, 84]}])

License

MIT. Upstream code is MIT-licensed as well.

Repository

hpack

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • about 5 hours ago
  • July 28, 2026
License

MIT License

Links
Synced at

Tue, 28 Jul 2026 01:21:18 GMT

Languages