sdcompress

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package sdcompress 一些常见的压缩算法

Index

Constants

View Source
const (
	GzipNoCompression      = GzipLevel(gzip.NoCompression)
	GzipBestSpeed          = GzipLevel(gzip.BestSpeed)
	GzipBestCompression    = GzipLevel(gzip.BestCompression)
	GzipDefaultCompression = GzipLevel(gzip.DefaultCompression)
	GzipHuffmanOnly        = GzipLevel(gzip.HuffmanOnly)
)
View Source
const (
	Lz4Fast   = Lz4Level(lz4.Fast)
	Lz4Level1 = Lz4Level(lz4.Level1)
	Lz4Level2 = Lz4Level(lz4.Level2)
	Lz4Level3 = Lz4Level(lz4.Level3)
	Lz4Level4 = Lz4Level(lz4.Level4)
	Lz4Level5 = Lz4Level(lz4.Level5)
	Lz4Level6 = Lz4Level(lz4.Level6)
	Lz4Level7 = Lz4Level(lz4.Level7)
	Lz4Level8 = Lz4Level(lz4.Level8)
	Lz4Level9 = Lz4Level(lz4.Level9)
)
View Source
const (
	ZlibNoCompression      = ZlibLevel(zlib.NoCompression)
	ZlibBestSpeed          = ZlibLevel(zlib.BestSpeed)
	ZlibBestCompression    = ZlibLevel(zlib.BestCompression)
	ZlibDefaultCompression = ZlibLevel(zlib.DefaultCompression)
	ZlibHuffmanOnly        = ZlibLevel(zlib.HuffmanOnly)
)

Variables

Functions

func Gzip

func Gzip(data []byte, level GzipLevel) ([]byte, error)

func Lz4

func Lz4(data []byte, level Lz4Level) ([]byte, error)

func Ungzip

func Ungzip(data []byte) ([]byte, error)

func Unlz4

func Unlz4(data []byte) ([]byte, error)

func Unzip

func Unzip(data []byte) ([]byte, error)

func Zip

func Zip(data []byte, level ZlibLevel) ([]byte, error)

Types

type GzipLevel

type GzipLevel int

type Lz4Level

type Lz4Level lz4.CompressionLevel

type ZlibLevel

type ZlibLevel int

Jump to

Keyboard shortcuts

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