help

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: BSD-3-Clause Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SM2UID = []byte{0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38}

Functions

func E added in v0.7.0

func E(code int64, msg string) *errors.Error

func ErrorHandler added in v0.11.0

func ErrorHandler() app.HandlerFunc

func HmacSha256 added in v0.11.0

func HmacSha256(s, key string) string

func IsEmpty added in v0.6.0

func IsEmpty(i any) bool

func MapToSignText added in v0.13.0

func MapToSignText(d map[string]any) string

func NewECB added in v0.13.0

func NewECB(b cipher.Block) *ecb

func PrivKeySM2FromBase64 added in v0.13.0

func PrivKeySM2FromBase64(v string) (priKey *sm2.PrivateKey, err error)

func Ptr added in v0.6.0

func Ptr[T any](i T) *T

func PubKeySM2FromBase64 added in v0.13.0

func PubKeySM2FromBase64(v string) (pubKey *ecdsa.PublicKey, err error)

func Random added in v0.6.0

func Random(n int, charset ...string) string

func RandomAlphabet added in v0.6.0

func RandomAlphabet(n int) string

func RandomLowercase added in v0.6.0

func RandomLowercase(n int) string

func RandomNumber added in v0.6.0

func RandomNumber(n int) string

func RandomUppercase added in v0.6.0

func RandomUppercase(n int) string

func Reverse added in v0.6.0

func Reverse[T any](v []T)

func ReverseString added in v0.6.0

func ReverseString(v string) string

func SID added in v0.11.0

func SID() string

func SM4Decrypt added in v0.13.0

func SM4Decrypt(hexkey string, ciphertext string) (plaintext string, err error)

func SM4Encrypt added in v0.13.0

func SM4Encrypt(hexkey string, plaintext string) (ciphertext string, err error)

func SM4Verify added in v0.13.0

func SM4Verify(key string, ciphertext string, plaintext string) (r bool, err error)

func Sha256hex added in v0.11.0

func Sha256hex(s string) string

func Shuffle added in v0.6.0

func Shuffle[T any](v []T)

func ShuffleString added in v0.6.0

func ShuffleString(v string) string

func Sm2Sign added in v0.13.0

func Sm2Sign(key *sm2.PrivateKey, text string) (_ string, err error)

func Sm2Verify added in v0.13.0

func Sm2Verify(pubKey *ecdsa.PublicKey, text string, sign string) (_ bool, err error)

func Uuid added in v0.6.0

func Uuid() string

func Validator added in v0.7.1

func Validator() *go_playground.Validator

Types

type ErrorMeta added in v0.11.0

type ErrorMeta struct {
	Code int64
}

type R added in v0.11.0

type R struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

func Fail added in v0.11.0

func Fail(code int64, msg string) R

func Ok added in v0.11.0

func Ok() R

Jump to

Keyboard shortcuts

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