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

# 使用 gzip 压缩和解压数据

使用 `Bun.gzipSync()` 以 gzip 格式压缩 `Uint8Array`。

```ts theme={"theme":{"light":"github-light","dark":"dracula"}}
const data = Buffer.from("Hello, world!");
const compressed = Bun.gzipSync(data);
// => Uint8Array

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

***

请参阅 [文档 > API > 工具](/runtime/utils) 获取更多实用工具。
