Ejemplo n.º 1
0
// NewArmorDecoderStream is used to decode armored encoding. It returns a stream you
// can read from, and also a Frame you can query to see what the open/close
// frame markers were.
func NewArmorDecoderStream(r io.Reader, params ArmorParams) (io.Reader, Frame, error) {
	fds := &framedDecoderStream{r: NewPunctuatedReader(r, params.Punctuation), params: params}
	ret := basex.NewDecoder(params.Encoding, fds)
	return ret, fds, nil
}
Ejemplo n.º 2
0
func (v *CmdBase62Decode) Run() error {
	_, err := io.Copy(os.Stdout, basex.NewDecoder(basex.Base62StdEncoding, os.Stdin))
	return err
}