help

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 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

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

func ErrorHandler

func ErrorHandler() app.HandlerFunc

func HmacSha256

func HmacSha256(s, key string) string

func IsEmpty

func IsEmpty(i any) bool

func MapToSignText

func MapToSignText(d map[string]any) string

func NewECB

func NewECB(b cipher.Block) *ecb

func PrivKeySM2FromBase64

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

func Ptr

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

func PubKeySM2FromBase64

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

func Random

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

func RandomAlphabet

func RandomAlphabet(n int) string

func RandomLowercase

func RandomLowercase(n int) string

func RandomNumber

func RandomNumber(n int) string

func RandomUppercase

func RandomUppercase(n int) string

func Reverse

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

func ReverseString

func ReverseString(v string) string

func SID

func SID() string

func SM4Decrypt

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

func SM4Encrypt

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

func SM4Verify

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

func Sha256hex

func Sha256hex(s string) string

func Shuffle

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

func ShuffleString

func ShuffleString(v string) string

func Sm2Sign

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

func Sm2Verify

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

func Uuid

func Uuid() string

func Validator

func Validator() *go_playground.Validator

Types

type ErrorMeta

type ErrorMeta struct {
	Code int64
}

type R

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

func Fail

func Fail(code int64, msg string) R

func Ok

func Ok() R

Jump to

Keyboard shortcuts

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