decode

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package decode 提供数据解码和压缩解压功能。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecompressGzip

func DecompressGzip(input []byte) ([]byte, error)

DecompressGzip 解压缩 gzip 格式的数据。 如果输入数据不是 gzip 格式,函数会尝试多种 Base64 解码方式(标准 Base64、无填充 Base64、 URL 安全 Base64、URL 安全无填充 Base64)对输入进行解码,然后解压缩。 返回解压缩后的原始数据,如果解压失败则返回错误。

func IsGzipped

func IsGzipped(data []byte) bool

IsGzipped 检查给定的数据是否为 gzip 格式。 通过检查数据的前两个字节是否为 gzip 魔数(0x1f 0x8b)来判断。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL