status-go/vendor/github.com/anacrolix/missinggo/encoding.go

16 lines
439 B
Go
Raw Normal View History

2022-03-10 09:44:48 +00:00
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 }