base64Kit

package
v3.0.22 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 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(src []byte, options ...Base64Option) ([]byte, error)

func DecodeString

func DecodeString(s string, options ...Base64Option) ([]byte, error)

func DecodeStringToString

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

func EncodeStringToString(s string, options ...Base64Option) string

EncodeStringToString (拓展) string => base64 string

func EncodeToString

func EncodeToString(src []byte, options ...Base64Option) string

Types

type Base64Option

type Base64Option func(opts *base64Options)

func WithEncoding

func WithEncoding(encoding *base64.Encoding) Base64Option

WithEncoding 默认: base64.StdEncoding.

@param encoding base64.StdEncoding || base64.URLEncoding || base64.RawStdEncoding || base64.RawURLEncoding

func WithPadding

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