Home | History | Annotate | Download | only in base64

Lines Matching defs:Encoding

5 // Package base64 implements base64 encoding as specified by RFC 4648.
9 "encoding/binary"
18 // An Encoding is a radix 64 encoding/decoding scheme, defined by a
19 // 64-character alphabet. The most common encoding is the "base64"
20 // encoding defined in RFC 4648 and used in MIME (RFC 2045) and PEM
21 // (RFC 1421). RFC 4648 also defines an alternate encoding, which is
22 // the standard encoding with - and _ substituted for + and /.
23 type Encoding struct {
38 // NewEncoding returns a new padded Encoding defined by the given alphabet,
41 // The resulting Encoding uses the default padding character ('='),
43 func NewEncoding(encoder string) *Encoding {
45 panic("encoding alphabet is not 64-bytes long")
49 panic("encoding alphabet contains newline character")
53 e := new(Encoding)
66 // WithPadding creates a new encoding identical to enc except
69 // be contained in the encoding's alphabet and must be a rune equal or
71 func (enc Encoding) WithPadding(padding rune) *Encoding {
86 // Strict creates a new encoding identical to enc except with
89 func (enc Encoding) Strict() *Encoding {
94 // StdEncoding is the standard base64 encoding, as defined in
98 // URLEncoding is the alternate base64 encoding defined in RFC 4648.
102 // RawStdEncoding is the standard raw, unpadded base64 encoding,
107 // RawURLEncoding is the unpadded alternate base64 encoding defined in RFC 4648.
116 // Encode encodes src using the encoding enc, writing
119 // The encoding pads the output to a multiple of 4 bytes,
122 func (enc *Encoding) Encode(dst, src []byte) {
169 // EncodeToString returns the base64 encoding of src.
170 func (enc *Encoding) EncodeToString(src []byte) string {
178 enc *Encoding
250 func NewEncoder(enc *Encoding, w io.Writer) io.WriteCloser {
254 // EncodedLen returns the length in bytes of the base64 encoding
256 func (enc *Encoding) EncodedLen(n int) int {
278 func (enc *Encoding) decodeQuantum(dst, src []byte, si int) (nsi, n int, err error) {
374 func (enc *Encoding) DecodeString(s string) ([]byte, error) {
383 enc *Encoding
457 // Decode decodes src using the encoding enc. It writes at most
462 func (enc *Encoding) Decode(dst, src []byte) (n int, err error) {
512 func (enc *Encoding) decode32(dst, src []byte) bool {
538 func (enc *Encoding) decode64(dst, src []byte) bool {
603 func NewDecoder(enc *Encoding, r io.Reader) io.Reader {
609 func (enc *Encoding) DecodedLen(n int) int {