YTSFlix_Go/vendor/github.com/anacrolix/missinggo/encoding.go
2018-11-04 15:58:15 +01:00

16 lines
439 B
Go

package missinggo
// An interface for "encoding/base64".Encoder
type Encoding interface {
EncodeToString([]byte) string
DecodeString(string) ([]byte, error)
}
// An encoding that does nothing.
type IdentityEncoding struct{}
var _ Encoding = IdentityEncoding{}
func (IdentityEncoding) EncodeToString(b []byte) string { return string(b) }
func (IdentityEncoding) DecodeString(s string) ([]byte, error) { return []byte(s), nil }