encoders

package
v0.0.6-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

README

encoders

General purpose data encoders.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASCIIEncoder

type ASCIIEncoder interface {
	Encode([]byte) string
	Decode(string) ([]byte, error)
}

ASCIIEncoder - Can losslessly encode arbitrary binary data to ASCII

type Base64

type Base64 struct{}

Base64 Encoder

func (Base64) Decode

func (e Base64) Decode(data string) ([]byte, error)

Decode - Base64 Decode

func (Base64) Encode

func (e Base64) Encode(data []byte) string

Encode - Base64 Encode

type BinaryEncoder

type BinaryEncoder interface {
	Encode(w io.Writer, data []byte) error
	Decode([]byte) ([]byte, error)
}

BinaryEncoder - Encodes data in binary format(s)

type English

type English struct{}

English Encoder - An ASCIIEncoder for binary to english text

func (English) Decode

func (e English) Decode(words string) ([]byte, error)

Decode - English => Binary

func (English) Encode

func (e English) Encode(data []byte) string

Encode - Binary => English

type Hex

type Hex struct{}

Hex Encoder

func (Hex) Decode

func (e Hex) Decode(data string) ([]byte, error)

Decode - Hex Decode

func (Hex) Encode

func (e Hex) Encode(data []byte) string

Encode - Hex Encode

type PNG

type PNG struct{}

func (PNG) Decode

func (p PNG) Decode(data []byte) ([]byte, error)

Decode reads a encoded PNG to get the original binary data

func (PNG) Encode

func (p PNG) Encode(w io.Writer, data []byte) error

Encode outputs a valid PNG file

Jump to

Keyboard shortcuts

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