Documentation ¶
Index ¶
- Variables
- func NewDecoder(enc *B62Encoding, r io.Reader) io.Reader
- func NewEncoder(enc *B62Encoding, w io.Writer) io.WriteCloser
- type B62Encoding
- func (enc *B62Encoding) AppendEncode(dst, src []byte) []byte
- func (enc *B62Encoding) Decode(dst, src []byte) (n int, err error)
- func (enc *B62Encoding) DecodeString(s string) ([]byte, error)
- func (enc *B62Encoding) DecodedLen(n int) int
- func (enc *B62Encoding) Encode(dst, src []byte)
- func (enc *B62Encoding) EncodeToString(src []byte) string
- func (enc *B62Encoding) EncodedLen(n int) int
- type CorruptInputError
Constants ¶
This section is empty.
Variables ¶
var B62StdEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
B62StdEncoding is the standard base64 encoding, as defined in RFC 4648.
Functions ¶
func NewDecoder ¶
func NewDecoder(enc *B62Encoding, r io.Reader) io.Reader
NewDecoder constructs a new base64 stream decoder.
func NewEncoder ¶
func NewEncoder(enc *B62Encoding, w io.Writer) io.WriteCloser
NewEncoder returns a new base64 stream encoder. Data written to the returned writer will be encoded using enc and then written to w. Base64 encodings operate in 4-byte blocks; when finished writing, the caller must Close the returned encoder to flush any partially written blocks.
Types ¶
type B62Encoding ¶
type B62Encoding struct {
// contains filtered or unexported fields
}
func NewEncoding ¶
func NewEncoding(encoder string) *B62Encoding
func (*B62Encoding) AppendEncode ¶
func (enc *B62Encoding) AppendEncode(dst, src []byte) []byte
AppendEncode appends the base64 encoded src to dst and returns the extended buffer.
func (*B62Encoding) DecodeString ¶
func (enc *B62Encoding) DecodeString(s string) ([]byte, error)
DecodeString returns the bytes represented by the base64 string s.
func (*B62Encoding) DecodedLen ¶
func (enc *B62Encoding) DecodedLen(n int) int
DecodedLen returns the maximum length in bytes of the decoded data corresponding to n bytes of base64-encoded data.
func (*B62Encoding) Encode ¶
func (enc *B62Encoding) Encode(dst, src []byte)
func (*B62Encoding) EncodeToString ¶
func (enc *B62Encoding) EncodeToString(src []byte) string
EncodeToString returns the base64 encoding of src.
func (*B62Encoding) EncodedLen ¶
func (enc *B62Encoding) EncodedLen(n int) int
EncodedLen returns the length in bytes of the base64 encoding of an input buffer of length n.
type CorruptInputError ¶
type CorruptInputError int64
func (CorruptInputError) Error ¶
func (e CorruptInputError) Error() string