Documentation ¶
Index ¶
Constants ¶
const Base32EncoderID = 65
Base32EncoderID - EncoderID
const Base58EncoderID = 43
Base62EncoderID - EncoderID
const Base64EncoderID = 13
Base64EncoderID - EncoderID
const Base64GzipEncoderID = 64
Base64GzipEncoderID - EncoderID
const ( // EncoderModulus - Nonce % EncoderModulus = EncoderID, and needs to be equal // to or greater than the largest EncoderID value. EncoderModulus = 101 )
const EnglishEncoderID = 31
EnglishEncoderID - EncoderID
const GzipEncoderID = 49
GzipEncoderID - EncoderID
const GzipEnglishEncoderID = 45
GzipEnglishEncoderID - EncoderID
const HexEncoderID = 92
HexEncoderID - EncoderID
const (
// PNGEncoderID - Encoder ID
PNGEncoderID = 22
)
Variables ¶
var EncoderMap = map[int]Encoder{ Base64EncoderID: Base64{}, HexEncoderID: Hex{}, EnglishEncoderID: English{}, GzipEncoderID: Gzip{}, GzipEnglishEncoderID: GzipEnglish{}, Base64GzipEncoderID: Base64Gzip{}, }
EncoderMap - Maps EncoderIDs to Encoders
Functions ¶
Types ¶
type Base32 ¶ added in v1.5.0
type Base32 struct{}
Base32 Encoder
type Base58 ¶ added in v1.5.0
type Base58 struct{}
Base58 Encoder
type Base64Gzip ¶
type Base64Gzip struct{}
Base64Gzip - Base64+Gzip encoder
func (Base64Gzip) Decode ¶
func (g Base64Gzip) Decode(data []byte) ([]byte, error)
Decode - Un-base64 gzip data
func (Base64Gzip) Encode ¶
func (g Base64Gzip) Encode(data []byte) []byte
Encode - Base64 encode gzip data
type Encoder ¶
Encoder - Can losslessly encode arbitrary binary data to ASCII
func EncoderFromNonce ¶
EncoderFromNonce - Convert a nonce into an encoder
func RandomEncoder ¶
RandomEncoder - Get a random nonce identifier and a matching encoder
func RandomTxtEncoder ¶ added in v1.5.0
RandomTxtEncoder - Get a random nonce identifier and a matching encoder
type English ¶
type English struct{}
English Encoder - An ASCIIEncoder for binary to english text
type Gzip ¶
type Gzip struct{}
Gzip - Gzip compression encoder
type GzipEnglish ¶
type GzipEnglish struct{}
GzipEnglish - Gzip+English encoder
func (GzipEnglish) Decode ¶
func (g GzipEnglish) Decode(data []byte) ([]byte, error)
Decode - Uncompressed english data with gzip
func (GzipEnglish) Encode ¶
func (g GzipEnglish) Encode(data []byte) []byte
Encode - Compress english data with gzip
type NoEncoder ¶
type NoEncoder struct{}
NoEncoder - A NOP encoder
type PNGEncoder ¶
type PNGEncoder struct{}
PNGEncoder - PNG image object
func (PNGEncoder) Decode ¶
func (p PNGEncoder) Decode(data []byte) ([]byte, error)
Decode reads a encoded PNG to get the original binary data
func (PNGEncoder) Encode ¶
func (p PNGEncoder) Encode(data []byte) []byte
Encode outputs a valid PNG file