Home | History | Annotate | Download | only in base64

Lines Matching refs:Encoding

5 // Package base64 implements base64 encoding as specified by RFC 4648.
17 // An Encoding is a radix 64 encoding/decoding scheme, defined by a
18 // 64-character alphabet. The most common encoding is the "base64"
19 // encoding defined in RFC 4648 and used in MIME (RFC 2045) and PEM
20 // (RFC 1421). RFC 4648 also defines an alternate encoding, which is
21 // the standard encoding with - and _ substituted for + and /.
22 type Encoding struct {
37 // NewEncoding returns a new padded Encoding defined by the given alphabet,
39 // The resulting Encoding uses the default padding character ('='),
41 func NewEncoding(encoder string) *Encoding {
43 panic("encoding alphabet is not 64-bytes long")
46 e := new(Encoding)
59 // WithPadding creates a new encoding identical to enc except
61 func (enc Encoding) WithPadding(padding rune) *Encoding {
66 // Strict creates a new encoding identical to enc except with
69 func (enc Encoding) Strict() *Encoding {
74 // StdEncoding is the standard base64 encoding, as defined in
78 // URLEncoding is the alternate base64 encoding defined in RFC 4648.
82 // RawStdEncoding is the standard raw, unpadded base64 encoding,
87 // RawURLEncoding is the unpadded alternate base64 encoding defined in RFC 4648.
96 // Encode encodes src using the encoding enc, writing
99 // The encoding pads the output to a multiple of 4 bytes,
102 func (enc *Encoding) Encode(dst, src []byte) {
149 // EncodeToString returns the base64 encoding of src.
150 func (enc *Encoding) EncodeToString(src []byte) string {
158 enc *Encoding
230 func NewEncoder(enc *Encoding, w io.Writer) io.WriteCloser {
234 // EncodedLen returns the length in bytes of the base64 encoding
236 func (enc *Encoding) EncodedLen(n int) int {
256 func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) {
349 // Decode decodes src using the encoding enc. It writes at most
354 func (enc *Encoding) Decode(dst, src []byte) (n int, err error) {
360 func (enc *Encoding) DecodeString(s string) ([]byte, error) {
369 enc *Encoding
471 func NewDecoder(enc *Encoding, r io.Reader) io.Reader {
477 func (enc *Encoding) DecodedLen(n int) int {