Documentation
¶
Index ¶
- Variables
- func AnyInSlice[T AnyInSliceType](v T, slice []T) bool
- func AnyPtr[T any](v T) *T
- func AnySet[T AnyInSliceType](list []T) []T
- func AnyString(o any) string
- func EnumInSlice[T EnumInSliceType](v T, slice []T) bool
- func GetECDHSecret(privateKey, publicKey string) (string, error)
- func GetPodIp() string
- func Md5(s string) string
- func Md5Bytes(b []byte) string
- func Md516(s string) string
- type AnyInSliceType
- type ECDH
- type EnumInSliceType
- type SSM
Constants ¶
This section is empty.
Variables ¶
View Source
var Aes = &xAes{}
View Source
var Bytes = &xBytes{}
View Source
var DecryptError = errors.New("aes decrypt error")
View Source
var Error = &xError{}
View Source
var File = &xFile{}
View Source
var Http = &xHttp{}
View Source
var Json = &xJson{}
View Source
var Map = &xMap{}
View Source
var Number = &xNumber{}
View Source
var Proto = &xProto{}
View Source
var Pwd = &xPwd{}
View Source
var Random = &xRandom{}
View Source
var Regex = &xRegex{}
View Source
var Retry = xRetry{}
View Source
var Sdp = &xSdp{}
View Source
var Snowflake *xSnowflake
View Source
var String = &xString{}
View Source
var Time = &xTime{}
View Source
var Trace = &xTrace{}
Functions ¶
func AnyInSlice ¶
func AnyInSlice[T AnyInSliceType](v T, slice []T) bool
func AnySet ¶
func AnySet[T AnyInSliceType](list []T) []T
func EnumInSlice ¶
func EnumInSlice[T EnumInSliceType](v T, slice []T) bool
func GetECDHSecret ¶
GetECDHSecret 使用自己的私钥和别人的公钥(hex),协商密钥
Types ¶
type AnyInSliceType ¶
type ECDH ¶
type ECDH interface {
// GenerateKey 生成公私钥对
GenerateKey(io.Reader) (crypto.PrivateKey, crypto.PublicKey, error)
// Marshal 将公钥转换为字节
Marshal(crypto.PublicKey) []byte
// Unmarshal 将字节转换为公钥
Unmarshal([]byte) (crypto.PublicKey, bool)
GenerateSharedSecret(crypto.PrivateKey, crypto.PublicKey) ([]byte, error)
// HexEncodePublicKeyToString 将公钥钥转换为hex字符串
HexEncodePublicKeyToString(crypto.PublicKey) string
// HexEncodePrivateKeyToString 将私钥转换为hex字符串
HexEncodePrivateKeyToString(crypto.PrivateKey) string
}
ECDH The main interface for ECDH key exchange.
type EnumInSliceType ¶
type EnumInSliceType interface {
String() string
}
type SSM ¶
func NewSSMFromBsonM ¶
Click to show internal directories.
Click to hide internal directories.