encodes

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package encodes provide some util for encode/decode data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64StdDecoding

func Base64StdDecoding(s string) ([]byte, error)

func Base64StdEncoding

func Base64StdEncoding(bs []byte) string

func Base64URLDecoding

func Base64URLDecoding(s string) ([]byte, error)

func Base64URLEncoding

func Base64URLEncoding(bs []byte) string

func Decode

func Decode(coding Encoding, str []byte) []byte

func DecodeString

func DecodeString(coding Encoding, str string) string

func Encode

func Encode(coding Encoding, src []byte) []byte

func EncodeString

func EncodeString(coding Encoding, str string) string

Types

type BaseEncoder

type BaseEncoder interface {
	Encode(dst []byte, src []byte)
	EncodeToString(src []byte) string
	Decode(dst []byte, src []byte) (n int, err error)
	DecodeString(s string) ([]byte, error)
	EncodedLen(n int) int
	DecodedLen(n int) int
}

BaseEncoder interface

type Encoding

type Encoding string

base32 encoding with no padding

const (
	B32Std Encoding = "B32Std"

	B32Hex Encoding = "B32Hex"
	B64Std Encoding = "B64Std"
	B64URL Encoding = "B64URL"
)

Jump to

Keyboard shortcuts

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