insight Simon Willison 2026-07-04T23:09 正文 ok 89 words

仅用500字节构建世界地图

英文标题:Building a World Map with only 500 bytes

Iwo Kadziela 在 Codex 的协助下,仅用 445 字节数据就生成了一幅逼真的 ASCII 世界地图。核心技巧是使用 deflate 压缩,并通过一段巧妙的 JavaScript 代码调用 fetch() 与 data: URI 进行解压渲染。该方法展示了在极端数据量限制下,如何利用浏览器内置能力实现创意传输与显示,为前端开发者提供了低带宽场景的新思路。
打开原文相关 3.6 · 机会 0
media18.2 KB

中文

2026年7月4日 - 链接博客

仅用500字节构建世界地图 (via) Iwo Kadziela(在 Codex 协助下)找到了一种方法,仅用 445 字节数据就生成了一幅可信的 ASCII 世界地图:

用黑色星号字符渲染的世界地图,看起来非常不错

关键技巧是使用 deflate 压缩,然后用这段精巧的 JavaScript 代码串联起来。我之前不知道可以像这样将 fetch() 与 data: URI 配合使用:

fetch('data:;base64,1ZpLsgIxCEXnrM...==').then( r => r.body.pipeThrough(new DecompressionStream('deflate-raw')) ).then( s => new Response(s).text() ).then( t => b.innerHTML = '' + t )

English / 原文

4th July 2026 - Link Blog

Building a World Map with only 500 bytes (via) Iwo Kadziela (assisted by Codex) figured out a way to generate a credible ASCII world map using 445 bytes of data:

A map of the world rendered as black asterisk ASCII characters, it looks very good

The key trick is to use deflate compression, which is then wired together using this neat snippet of JavaScript. I didn't know you could use fetch() with data: URIs like this:

fetch('data:;base64,1ZpLsgIxCEXnrM...==').then(
  r => r.body.pipeThrough(new DecompressionStream('deflate-raw'))
).then(
  s => new Response(s).text()
).then(
  t => b.innerHTML = '<pre style=font-size:.65vw>' + t
)