Lines Matching refs:Encoding
5 // Package base32 implements base32 encoding as specified by RFC 4648.
19 // An Encoding is a radix 32 encoding/decoding scheme, defined by a
20 // 32-character alphabet. The most common is the "base32" encoding
22 // The alternate "base32hex" encoding is used in DNSSEC.
23 type Encoding struct {
37 // NewEncoding returns a new Encoding defined by the given alphabet,
39 func NewEncoding(encoder string) *Encoding {
40 e := new(Encoding)
53 // StdEncoding is the standard base32 encoding, as defined in
68 // WithPadding creates a new encoding identical to enc except
71 // be contained in the encoding's alphabet and must be a rune equal or
73 func (enc Encoding) WithPadding(padding rune) *Encoding {
92 // Encode encodes src using the encoding enc, writing
95 // The encoding pads the output to a multiple of 8 bytes,
98 func (enc *Encoding) Encode(dst, src []byte) {
177 // EncodeToString returns the base32 encoding of src.
178 func (enc *Encoding) EncodeToString(src []byte) string {
186 enc *Encoding
258 func NewEncoder(enc *Encoding, w io.Writer) io.WriteCloser {
262 // EncodedLen returns the length in bytes of the base32 encoding
264 func (enc *Encoding) EncodedLen(n int) int {
285 func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) {
321 // valid dlen values. See RFC 4648 Section 6 "Base 32 Encoding" listing
376 // Decode decodes src using the encoding enc. It writes at most
381 func (enc *Encoding) Decode(dst, src []byte) (n int, err error) {
388 func (enc *Encoding) DecodeString(s string) ([]byte, error) {
397 enc *Encoding
505 func NewDecoder(enc *Encoding, r io.Reader) io.Reader {
511 func (enc *Encoding) DecodedLen(n int) int {