XU XUv0.16.0

#compress/lzw

导入方式: #compress/lzw

公开 API: 3 函数, 0 方法, 0 类型, 2 常量, 0 方法集

GIF LSB / PDF MSB LZW。

const LSB

XuAPI
pub const LSB = 0

用途

常量 LSB,定义了相关的协议或算法配置参数。

const MSB

XuAPI
pub const MSB = 1

用途

常量 MSB,定义了相关的协议或算法配置参数。

encode

XuAPI
pub fn encode(src &string, order int, lit_width int) string

用途

执行数据编码并返回结果。失败时抛出错误,调用方需处理或继续传播。

参数

src &string
源数据(只读借用,调用方仍持有原值;类型 &string)
order int
order(int)
lit_width int
lit_width(int)

返回值

string — 结果字符串

decode

XuAPI
pub fn decode(src &string, order int, lit_width int) string

用途

从编码数据中还原原始数据。失败时抛出错误,调用方需处理或继续传播。

参数

src &string
源数据(只读借用,调用方仍持有原值;类型 &string)
order int
order(int)
lit_width int
lit_width(int)

返回值

string — 结果字符串

decode_limit

XuAPI
pub fn decode_limit(src &string, order int, lit_width int, limit int) string

用途

解码 limit 数据。失败时抛出错误,调用方需处理或继续传播。

参数

src &string
源数据(只读借用,调用方仍持有原值;类型 &string)
order int
order(int)
lit_width int
lit_width(int)
limit int
limit(int)

返回值

string — 结果字符串