helper

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCbcDecrypt added in v0.1.38

func AesCbcDecrypt(input, aesKey []byte) ([]byte, error)

func AesCbcDecryptWithIv added in v0.1.38

func AesCbcDecryptWithIv(data, key, iv []byte) ([]byte, error)

func AesCbcEncrypt added in v0.1.38

func AesCbcEncrypt(input, aesKey []byte) ([]byte, error)

func AesCbcEncryptWithIv added in v0.1.38

func AesCbcEncryptWithIv(data, key, iv []byte) ([]byte, error)

func AesGcmDecrypt added in v0.1.38

func AesGcmDecrypt(data []byte, aesKey []byte) ([]byte, error)

func AesGcmDecryptWithIv added in v0.1.38

func AesGcmDecryptWithIv(data []byte, aesKey []byte, iv []byte) ([]byte, error)

func AesGcmEncrypt added in v0.1.38

func AesGcmEncrypt(data, aesKey []byte) ([]byte, error)

func AesGcmEncryptWithIv added in v0.1.38

func AesGcmEncryptWithIv(data, aesKey, iv []byte) ([]byte, error)

func ArrayMapFormatCase added in v0.1.36

func ArrayMapFormatCase(data []map[string]interface{}, toSnake bool) []map[string]interface{}

func BufReadUShort added in v0.1.34

func BufReadUShort(buf io.Reader) (uint16, error)

func BufReadUint added in v0.1.34

func BufReadUint(buf io.Reader) (uint, error)

func BufReadUint32 added in v0.1.34

func BufReadUint32(buf io.Reader) (uint32, error)

func BufReadUint64 added in v0.1.34

func BufReadUint64(buf io.Reader) (uint64, error)

func BufWriteUShort added in v0.1.34

func BufWriteUShort(buf io.Writer, data uint16) error

func BufWriteUint added in v0.1.34

func BufWriteUint(buf io.Writer, data uint) error

func BufWriteUint32 added in v0.1.34

func BufWriteUint32(buf io.Writer, data uint32) error

func BufWriteUint64 added in v0.1.34

func BufWriteUint64(buf io.Writer, data uint64) error

func BytesToStr added in v0.1.34

func BytesToStr(data []byte) string

func Compress added in v0.1.34

func Compress(data []byte) ([]byte, error)

func Convertor

func Convertor[S any](source interface{}) (*S, error)

func CreateEcdhKeyPair added in v0.1.38

func CreateEcdhKeyPair(curve ecdh.Curve) (*ecdh.PrivateKey, []byte, error)

func Decompress added in v0.1.34

func Decompress(compressed []byte) ([]byte, error)

func FileMD5 added in v0.1.41

func FileMD5(file *os.File, chunkSize int64, chunkFn func(chunkBytes []byte)) ([]byte, error)

func GetArchBit added in v0.1.34

func GetArchBit() int

func GetEcdhPubKey added in v0.1.38

func GetEcdhPubKey(pubKeyBytes []byte, curve ecdh.Curve) (*ecdh.PublicKey, error)

func GetEcdhSharedKey added in v0.1.38

func GetEcdhSharedKey(myPriKey *ecdh.PrivateKey, otherPubKey *ecdh.PublicKey) ([]byte, error)

func LowerCamelConvertor added in v0.1.33

func LowerCamelConvertor[S any](source interface{}) (*S, error)

func MapFormatCase added in v0.1.36

func MapFormatCase(data map[string]interface{}, toSnake bool) map[string]interface{}

func MapGet added in v0.1.6

func MapGet[T any](data map[string]interface{}, key string) T

func Marshal

func Marshal(object interface{}) ([]byte, error)

func SnakeConvertor added in v0.1.21

func SnakeConvertor[S any](source interface{}) (*S, error)

SnakeConvertor 默认转字段key为蛇形

func ToLowerCamelJson added in v0.1.2

func ToLowerCamelJson(snakeJson []byte) ([]byte, error)

func ToSnakeJson added in v0.1.20

func ToSnakeJson(lowerCamelJson []byte) ([]byte, error)

func Unmarshal

func Unmarshal[S any](jsonData []byte) (*S, error)

func UnmarshalUseNumber added in v0.2.3

func UnmarshalUseNumber[S any](jsonData []byte) (*S, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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