Documentation ¶
Index ¶
- func Decode(src []byte, options ...Base64Option) ([]byte, error)
- func DecodeString(s string, options ...Base64Option) ([]byte, error)
- func DecodeStringToString(s string, 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 EncodeStringToString(s 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 DecodeString ¶
func DecodeString(s string, options ...Base64Option) ([]byte, error)
func DecodeStringToString ¶ added in v2.1.30
func DecodeStringToString(s string, options ...Base64Option) (string, error)
DecodeStringToString (拓展) base64 string => string
func Encode ¶
func Encode(src []byte, options ...Base64Option) []byte
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 EncodeStringToString ¶ added in v2.1.30
func EncodeStringToString(s string, options ...Base64Option) string
EncodeStringToString (拓展) string => base64 string
func EncodeToString ¶
func EncodeToString(src []byte, options ...Base64Option) 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 默认: base64.StdEncoding.
@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.