LZSS compression package for Go.
go get github.com/blacktop/lzss
import (
"io/ioutil"
"log"
"github.com/blacktop/lzss"
"github.com/pkg/errors"
)
func main() {
dat, err := ioutil.ReadFile("compressed.bin")
if err != nil {
log.Fatal(errors.Wrap(err, "failed to read compressed file"))
}
decompressed := lzss.Decompress(dat)
err = ioutil.WriteFile("compressed.bin.decompressed", decompressed, 0644)
if err != nil {
log.Fatal(errors.Wrap(err, "failed to decompress file"))
}
}
NOTE: I believe lzss expects the data to be word aligned.
Converted to Golang from BootX-81//bootx.tproj/sl.subproj/lzss.c
- add Compress func
MIT Copyright (c) 2018 blacktop