system

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptPrivate

func DecryptPrivate(cipherText []byte) ([]byte, error)

func DecryptPublic

func DecryptPublic(cipherText []byte) ([]byte, error)

func EncryptPrivate

func EncryptPrivate(src []byte) (bytesEncrypt []byte, err error)

RsaEncryptBlock 私钥加密-分段

func EncryptPublic

func EncryptPublic(src []byte) (bytesEncrypt []byte, err error)

RsaEncryptBlock 公钥加密-分段

func FilteredSQLInject

func FilteredSQLInject(to_match_str string) bool

func GenerateRSAKey

func GenerateRSAKey(bits int, outPath string, fileName string)

生成RSA私钥和公钥,保存到文件中

func GetLocalIp

func GetLocalIp() string

func GetPathOfProgram

func GetPathOfProgram() string

func GetPathSymbol

func GetPathSymbol() string

func IsRelease

func IsRelease() bool

func MD5

func MD5(str string) string

func MD5Any

func MD5Any(object any) string

func PrivateEncrypt

func PrivateEncrypt(privt *rsa.PrivateKey, data []byte) ([]byte, error)

func PublicDecrypt

func PublicDecrypt(pub *rsa.PublicKey, data []byte) ([]byte, error)

func RandChar

func RandChar(size int) string

func RandChar16H

func RandChar16H(size int) string

func RandCharCrypto

func RandCharCrypto(size int) string

func RemoteIp

func RemoteIp(r *http.Request) string

func SHA1

func SHA1(str string) string

func SHA256

func SHA256(str string) string

func SaveConfigJson

func SaveConfigJson(path string, dest any) error

func ScanConfigJson

func ScanConfigJson(path string, dest any)

func SetPrivateKey

func SetPrivateKey(path string)

func SetPrivateKeyByIO

func SetPrivateKeyByIO(fs io.Reader)

func SetPublicKey

func SetPublicKey(path string)

func SetPublicKeyByIO

func SetPublicKeyByIO(fs io.Reader)

func UUID

func UUID() string

Types

type ObjectId

type ObjectId string

func GetGUID

func GetGUID() ObjectId

GUID returns a new unique ObjectId. 4byte 时间, 3byte 机器ID 2byte pid 3byte 自增ID

func (ObjectId) Hex

func (id ObjectId) Hex() string

Hex returns a hex representation of the ObjectId. 返回16进制对应的字符串

Jump to

Keyboard shortcuts

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