Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

huffmandemo/v0 package

Overview

Package huffmandemo is a small gnoweb demo of the canonical Huffman codec provided by the p/moul/x/daily/huffman(/p/moul/x/daily/huffman/v0) library: the code table for a worked example, what the packed stream looks like, what the skew is worth, and the two inputs that break a naive implementation.

It contains no codec logic of its own. Stateless, so Render is deterministic: every figure below is computed from the fixed strings at the top of this file, never from chain state, which is what lets an example test pin the page.

Function

Render

func Render(path string) string
Ask AI Claude ChatGPT

Render renders the demo for gnoweb.

Example
1Render("") / Render("/") -> the worked example, the ratios, the edge cases
2Render("/<text>")        -> encode that text and show its table

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1magld5ptgzaktqcexxq0pgq5lmdf0kz6re8hlv/x/daily/huffmandemo/v0.Render()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g1magld5ptgzaktqcexxq0pgq5lmdf0kz6re8hlv/x/daily/huffmandemo/v0, for example a function call with arguments.