source

package
v0.0.0-...-ba1a01a Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const RELATIVE = 1

RELATIVE define the started count to current index

Variables

This section is empty.

Functions

This section is empty.

Types

type LZSS

type LZSS struct {
	Mode          int
	DictSize      int
	PositionMode  int
	NumByteEncode int
	MaxMatch      int
	MinMatch      int
	Length        int
	Position      int
	MaskLength    uint32
	MaskPosition  uint32
}

LZSS config struct for lzss

func (*LZSS) AddToCompressData

func (c *LZSS) AddToCompressData(compressData []byte, tmpU, flags uint32, encoded bool) []byte

AddToCompressData add encoded data in final byte array

func (*LZSS) Compress

func (c *LZSS) Compress(rawData []byte) []byte

Compress choose good mode for compression

func (*LZSS) CompressMode0

func (c *LZSS) CompressMode0(rawData []byte) []byte

CompressMode0 compress in lzss with mode 0

func (*LZSS) CompressMode1

func (c *LZSS) CompressMode1(rawData []byte) []byte

CompressMode1 compress in lzss with mode 1

func (*LZSS) CountBitToZero

func (c *LZSS) CountBitToZero(n byte) uint32

CountBitToZero convert []byte to uint32

func (*LZSS) Decompress

func (c *LZSS) Decompress(compressData []byte) []byte

Decompress choose good mode for decompression

func (*LZSS) DecompressMode0

func (c *LZSS) DecompressMode0(compressData []byte) []byte

DecompressMode0 decompress in lzss with mode 0

func (*LZSS) DecompressMode1

func (c *LZSS) DecompressMode1(compressData []byte) []byte

DecompressMode1 decompress in lzss with mode 1

func (*LZSS) GetChunkByte

func (c *LZSS) GetChunkByte(data []byte, min, max int) []byte

GetChunkByte slice byte array without error bound range

func (*LZSS) GetEncodedData

func (c *LZSS) GetEncodedData(chunk uint32) (position, length int)

GetEncodedData return feature encoded pattern

func (*LZSS) Init

func (c *LZSS) Init()

Init initialize the config

func (*LZSS) PutByteToUint32

func (c *LZSS) PutByteToUint32(data []byte) uint32

PutByteToUint32 convert []byte to uint32

func (*LZSS) PutUint32ToByte

func (c *LZSS) PutUint32ToByte(x uint32) (buffer []byte, nbWrite int)

PutUint32ToByte convert uint32 to []byte

func (*LZSS) SearchBytePattern

func (c *LZSS) SearchBytePattern(data, pattern []byte, excludeIndex int) (position, length int)

SearchBytePattern search the maximal substring length

Jump to

Keyboard shortcuts

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