[gp] GlyphPack
RUST / WASM · CHROME 109+ · 0BSD

Binary, packed into text.

Turn files into glyphs, get the exact bytes back, and take them offline.
Files stay in your browser. No uploads. No framework.

Loading the local engines…

01 Workbench

Start with a real example
Encoding options

Browser gzip is separate from the codec. Its compression level is chosen by the browser. UTF-8 modes use their own bounded mask search.

Bytes in

UTF-8 text

GlyphPack payload

UTF-16 code units

Choose an example to get started.

Codec input bytes—
Native payload bytes—
Same glyphs · UTF-8—
Equivalent base64—

GlyphPack is an encoding, not compression. Native size follows the chosen UTF-8, UTF-16LE or Windows-1252 transport.

Bytes out

The decoded result will appear here.
A preview of the actual decoded bytes.
Use this decoder in your code

        

02 Small, useful recipes

Load a packed file

A .gp16 payload contains UTF-16LE code units. Read bytes before decoding text.

import {binary} from './full.min.mjs';

const res = await fetch('asset.gp16');
const payload = new TextDecoder('utf-16le')
  .decode(await res.arrayBuffer());
const bytes = binary(payload);

Restore structured data

JSON, manifests and configuration keep their exact original UTF-8 bytes.

const bytes = binary(payload);
const json = JSON.parse(
  new TextDecoder().decode(bytes)
);
console.log(json);

Restore a compressed asset

Inflation is a second, explicit step. The gzip log example uses this exact flow.

const compressed = binary(payload);
const stream = new Blob([compressed])
  .stream().pipeThrough(
    new DecompressionStream('gzip')
  );
const bytes = new Uint8Array(
  await new Response(stream).arrayBuffer()
);

Package a file offline

“Make standalone HTML” includes the decoder and your payload. It runs from a local file with no neighboring assets.

glyphpack encode input.bin \
  --checksum secure -o asset.gp16

# Get the Rust tools from the repository.
# Or encode your file in this workbench.

03 See the checks work

Real inputs sent to the decoder: a changed byte, a truncated header, and a noncanonical representation. These do not change your workbench.

Run the examples to compare byte integrity with format verification.

BLAKE3 is an unkeyed digest. It detects corruption; someone who can replace both data and digest can calculate a new one.

04 Take only what you need

All release files ↗

Each file is self-contained. Native gzip + base64 loads its Wasm once during import; binary() is synchronous afterward. The optional memory lookup is off by default.