base64Kit

package
v2.1.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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(str []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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL