lzss

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 3 Imported by: 0

README

LZSS

A simple LZSS implementation using marker bit grouping.

Usage

package main

import (
    "bytes"
    "fmt"
    "os"

    "github.com/For-ACGN/LZSS"
)

func main() {
    raw, err := os.ReadFile("test.dat")
    checkError(err)

    output, err := lzss.Compress(raw, 1024)
    checkError(err)

    output = lzss.Decompress(output, len(raw))
    fmt.Println(bytes.Equal(raw, output))
}

func checkError(err error) {
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(data []byte, windowSize int) ([]byte, error)

Compress is used to compress raw data with window size.

func Decompress

func Decompress(data []byte, rawSize int) []byte

Decompress is used to decompress the data with raw size.

Types

This section is empty.

Jump to

Keyboard shortcuts

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