dresscodec — reversible codec for dressed-up hashes

reversible codec · bytes in, custom hash out
data ⇄ dress
lossless reversible
build v1.0.3

dresscodec puts a dress on your data: a reversible codec that turns JSON, text, or bytes into compact, formattable strings — and exactly back again. A Reader is the dress code for your data (character set, format, schema). With it you encode a message into a hash and share the reader as a Key. Not a crypto digest: whoever holds the key decodes.

Load a ready-made example — click one to fill in every field:
01Reader

Step 1 · Start here. A Reader is the dress code for your data. Type an alphabet or click a preset like base62 — that alone is enough to begin. Everything else on this panel is optional fine-tuning. At the bottom you get a Reader-Key: your reader as one shareable string, so anyone with it can decode your hashes.

Flat character set — or a regex format, e.g. [A-Z]{4}-[A-Z]{4}-[A-Z]{4}-[A-Z]{4}-[A-Z]{4} (fixed length & capacity, literals = separators). Classes: [A-Z] [a-z] [0-9] \d \w · {n} fixed repetition.
?
?
JSON mode
Types: u8 u16 u32 uv · i8 i16 i32 iv · f32 f64 · unorm8 unorm16 snorm8 · bool · enum:a,b,c · str · json · [T] · {…}. Order = layout. Quantized types are lossy; only schema fields survive.
base
bits / char
checksum
transforms
02Message

Step 2 · Encode & decode. Put your data in the box and press Encode → — the Hash appears below. Press ← Decode to turn a hash back into the original data.

Length 0 / 0 chars
json bytes
hash chars
max chars
ratio
03Usage

Step 3 · Use it in code. Install dresscodec (zero runtime dependencies), then pick one of two ways: build a brand-new reader from scratch, or load the exact reader you configured on this page from its Reader-Key.

A · Use the reader from this page
Copy your Reader-Key (RDR1.…) from the Reader panel above and paste it as the argument. fflate is an optional peer dep, only for the deflate transform.
import { importReader } from 'dresscodec';

// paste the Reader-Key you copied from section 01 (starts with "RDR1.")
const reader = importReader('RDR1.…');

// decode hashes made with it — or encode new matching ones
const data = reader.decode('#7bQ…');
const hash = reader.encode({ level: 7, seed: 9183 });
B · New reader from scratch
import { Reader, ALPHABETS } from 'dresscodec';

// build a reader — the "dress code" for your data
const reader = new Reader('message', { alphabet: ALPHABETS.base62, prefix: '#' });

// encode a value → compact hash, then decode it back
const hash = reader.encode({ level: 7, seed: 9183 });
const data = reader.decode(hash);   // { level: 7, seed: 9183 }