> ## Documentation Index
> Fetch the complete documentation index at: https://bun.ll1025.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 gzip 压缩和解压数据

使用 `Bun.gzipSync()` 对 `Uint8Array` 进行 gzip 压缩。

```ts theme={null}
const data = Buffer.from("Hello, world!");
const compressed = Bun.gzipSync(data);
// => Uint8Array

const decompressed = Bun.gunzipSync(compressed);
// => Uint8Array
```

***

参见 [工具](/runtime/utils)。
