lzw

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 2 Imported by: 0

README

LZW compression

func Example() {
	data := []byte("howhowhowhowhowhowhowhowhow")
	compressed := Compress(data)
	fmt.Printf("performance %.4f\n", float64(len(compressed))/float64(len(data)))
	fmt.Println(string(Decompress(compressed)))

	// Output:
	// performance 0.8889
	// howhowhowhowhowhowhowhowhow
}

Documentation

Overview

Example
data := []byte("howhowhowhowhowhowhowhowhow")
compressed := Compress(data)
fmt.Printf("performance %.4f\n", float64(len(compressed))/float64(len(data)))
fmt.Println(string(Decompress(compressed)))
Output:

performance 0.8889
howhowhowhowhowhowhowhowhow

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(data []byte) (out []byte)

Compress data using LZW algorithm

func Decompress

func Decompress(data []byte) (out []byte)

Decompress data compressed by LZW algorithm

Types

This section is empty.

Jump to

Keyboard shortcuts

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