Documentation ¶
Index ¶
- func Decode(data []byte, options ...Base64Option) ([]byte, error)
- func DecodeString(str string, options ...Base64Option) ([]byte, error)
- func DecodeStringToString(str string, options ...Base64Option) (string, error)
- func DecodeToString(data []byte, options ...Base64Option) (string, error)
- func Encode(src []byte, options ...Base64Option) []byte
- func EncodeFile(path string, options ...Base64Option) ([]byte, error)
- func EncodeFileToString(path string, options ...Base64Option) (string, error)
- func EncodeString(str string, options ...Base64Option) []byte
- func EncodeStringToString(src string, options ...Base64Option) string
- func EncodeToString(src []byte, options ...Base64Option) string
- type Base64Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(data []byte, options ...Base64Option) ([]byte, error)
Decode []byte => []byte
参考: gbase64.Decode()
func DecodeString ¶
func DecodeString(str string, options ...Base64Option) ([]byte, error)
DecodeString string => []byte
func DecodeStringToString ¶ added in v2.1.30
func DecodeStringToString(str string, options ...Base64Option) (string, error)
DecodeStringToString string => string
func DecodeToString ¶
func DecodeToString(data []byte, options ...Base64Option) (string, error)
DecodeToString []byte => string
func Encode ¶
func Encode(src []byte, options ...Base64Option) []byte
Encode []byte => []byte
参考: gbase64.Encode()
func EncodeFile ¶
func EncodeFile(path string, options ...Base64Option) ([]byte, error)
EncodeFile file => []byte
func EncodeFileToString ¶
func EncodeFileToString(path string, options ...Base64Option) (string, error)
EncodeFileToString file => string
func EncodeString ¶
func EncodeString(str string, options ...Base64Option) []byte
EncodeString string => []byte
func EncodeStringToString ¶ added in v2.1.30
func EncodeStringToString(src string, options ...Base64Option) string
EncodeStringToString string => string
func EncodeToString ¶
func EncodeToString(src []byte, options ...Base64Option) string
EncodeToString []byte => string
Types ¶
type Base64Option ¶ added in v2.1.30
type Base64Option func(opts *base64Options)
func WithEncoding ¶ added in v2.1.30
func WithEncoding(encoding *base64.Encoding) Base64Option
WithEncoding
@param encoding base64.StdEncoding || base64.URLEncoding || base64.RawStdEncoding || base64.RawURLEncoding
func WithPadding ¶ added in v2.1.30
func WithPadding(padding *rune) Base64Option
WithPadding
PS: (1) base64.StdEncoding 和 base64.URLEncoding 的padding: '='(61) (2) base64.RawStdEncoding 和 base64.RawURLEncoding 的padding: -1(base64.NoPadding)
Click to show internal directories.
Click to hide internal directories.