pxl

package module
v0.0.0-...-670caa7 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 13 Imported by: 0

README

PXL

pxl is a command-line tool for converting files to pxl images. In some cases this can save some bytes when transfering the data or just retuns a spacy image.

go report card Build Status MIT license GoDoc

Usage

encoding:

./pxl -e example/xellio.jpg

original file --> pxl image

decoding:

./pxl -d xellio.jpg.pxl

pxl image --> original file

More usefull example

Assume we have a ~20MB-logfile like this:

for i in {1..100000}
do
	echo '127.0.0.1 - - [20/Aug/2017:13:08:24 +0200] "GET / HTTP/1.1" 403 189 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/60.0.3112.78 Chrome/60.0.3112.78 Safari/537.36"' >> ./logfile.log
done

Running

./pxl -e logfile.log

will create a ~100KB file, containing all the information from logfile.log

Better than any other compression?

No, probably not - But it looks good

Warning

Encoding too lage files can freeze your computer (depending on your hardware)

Documentation

Index

Constants

View Source
const (
	// Version ...
	Version = 1.0
	// ProductName ...
	ProductName = "PXL"
	// Author ...
	Author = "xellio"
	// Contact ...
	Contact = "https://github.com/xellio"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pxl

type Pxl struct {
	IsEncodeMode bool
	IsDecodeMode bool
	Source       string
	Target       string
	// contains filtered or unexported fields
}

The Pxl struct definition

func (*Pxl) Decode

func (p *Pxl) Decode() error

Decode the Pxl.Source and stores it to Pxl.decodedPayload

func (*Pxl) Encode

func (p *Pxl) Encode() error

Encode the Pxl.Source and stores it to Pxl.encodedPayload

func (Pxl) Process

func (p Pxl) Process() error

Process checks the context on the Pxl struct Encode the Source if Pxl.IsEncodeMode Decode the Source if Pxl.IsDecodeMode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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