Eric Spencer b12948bbef fix: undefined search reference and misplaced index suffix
`search` was never declared, so any link whose entire path is `/index.html`
or `/index.php` (the path is empty once the suffix is stripped) threw a
ReferenceError whenever the hostname had a subdomain or an unknown SLD.
`pathSegments.length` is what the check was reaching for.

With that fixed, those links reached a second bug: `indexSuffix` was
appended after the query and hash, so `x.io/index.html?q=1` decoded to
`x.io?q=1/index.html`. It is now spliced back in before the first `?`/`#`.
2026-08-14 09:45:13 +03:00
2026-08-13 14:53:25 +03:00
2026-08-09 13:17:47 +03:00
2026-08-13 14:56:04 +03:00
2026-08-13 15:15:58 +03:00
2026-08-09 13:12:48 +03:00
2026-08-09 13:17:47 +03:00
2026-08-09 13:17:47 +03:00
2026-08-09 13:17:47 +03:00

ha.mr

Compresses links and optimizes QR codes entirely in the browser, without a back-end database.

How

  1. Common parts of the link (e.g. protocol, www. prefix, index.html) are manually detected and reduced to individual bits. If present, the port is encoded as a raw numeric value.
  2. Second-level and top-level domains are matched against a Huffman-coded dictionary of the most common websites and TLDs.
  3. The rest of the link is split into parts, and each segment is either fitted to a predefined character set, or Huffman coded.
  4. For links, the output is encoded in the full character set of a URL. (I've been informed that square brackets [] are not supposed to be a part of this set, but it's too late to change that now.)
  5. For QR codes, the output uses the alphanumeric character set to remove overhead compared to other QR code generators.

Acknowledgements

S
Description
Static URL compressor and QR code optimizer
Readme MIT 187 KiB
Languages
HTML 52.2%
JavaScript 46.8%
Dockerfile 1%