Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Codecs = []struct { Name string CodecCons codecConstructor }{ { b16name, codecConstructor(NewB16CodecC), }, { b32name, codecConstructor(NewB32CodecC), }, { b64name, codecConstructor(NewB64CodecC), }, { urlname, codecConstructor(NewURLCodecC), }, { gzipname, codecConstructor(NewGzipCodecC), }, }
Functions ¶
Types ¶
type Base16 ¶
type Base16 struct {
// contains filtered or unexported fields
}
Base16 takes a decoder and an input string
type Base32 ¶
type Base32 struct {
// contains filtered or unexported fields
}
Base32 takes a decoder and an input string
type Base64 ¶
type Base64 struct {
// contains filtered or unexported fields
}
Base64 takes a decoder and an input string
type Checker ¶
type Checker interface {
Check() (acceptability float64)
}
Checker returns a metric to determine how likely it is for the given string to be a valid value for the specified Checker Type. The likelihood always ranges between 0 and 1
type CodecC ¶
CodecC creates an interface of interfaces usable by other codecs
func NewB16CodecC ¶
NewB16CodecC state machine to smartly decode a string with invalid chars nolint: gocyclo
func NewB32CodecC ¶
NewB32CodecC state machine to smartly decode a string with invalid chars nolint: gocyclo
func NewB64CodecC ¶
NewB64CodecC state machine to smartly decode a string with invalid chars and different variants nolint: gocyclo
func NewGzipCodecC ¶
NewGzipCodecC initialize a new gzip decoder object
func SmartDecode ¶
SmartDecode loops through the available CodecCs and determine which one is the best one to use
type Decoder ¶
type Decoder interface {
Decode() (output string)
}
Decoder decodes the string and returns a decoded value that tries to skip invalid input and to decode as much as possible. Returns if the decoded string can be printed as valid unicode.