Documentation ¶
Index ¶
- func AesDecrypt(crypted, key []byte, iv []byte, unPaddingFunc func([]byte) []byte) ([]byte, error)
- func AesDecryptPkcs5(crypted []byte, key []byte, iv []byte) ([]byte, error)
- func AesDecryptPkcs7(crypted []byte, key []byte, iv []byte) ([]byte, error)
- func AesDecryptPkcs7Base64(crypted []byte, key []byte, iv []byte) ([]byte, error)
- func AesDecryptSimple(crypted []byte, key string, iv string) ([]byte, error)
- func AesEncrypt(origData []byte, key []byte, iv []byte, paddingFunc func([]byte, int) []byte) ([]byte, error)
- func AesEncryptPkcs5(origData []byte, key []byte, iv []byte) ([]byte, error)
- func AesEncryptPkcs7(origData []byte, key []byte, iv []byte) ([]byte, error)
- func AesEncryptPkcs7Base64(origData []byte, key []byte, iv []byte) ([]byte, error)
- func AesEncryptSimple(origData []byte, key string, iv string) ([]byte, error)
- func AnyToDecimal(num string, n int) int64
- func ArrayContains(items []string, target string) bool
- func BoolToInt(b bool) int
- func CopyFile(dstName, srcName string) (written int64, err error)
- func DecimalToAny(num int64, n int) string
- func FormatSlots(slots []uint32) string
- func GenUUID() string
- func GetCurve25519Key(private, public [32]byte) (Key [32]byte)
- func GetCurve25519KeypPair() (Aprivate, Apublic [32]byte)
- func GetExternalIP() (string, error)
- func GetIntranetIP() (ips []string, err error)
- func GetRandomString(num int) string
- func GetSlotNum(slotCount int, v string) uint32
- func HashCrc32(str string) uint32
- func IntToBool(b int) bool
- func IsIntranet(ipStr string) bool
- func JSONToMap(json string) (map[string]interface{}, error)
- func JsonToMap(json string) (map[string]interface{}, error)
- func MD5(str string) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func ReadJSONByByte(body []byte, obj interface{}) error
- func ReadJsonByByte(body []byte, obj interface{}) error
- func RemoveRepeatedElement(arr []string) (newArr []string)
- func SlotsContains(b, subslice []byte) bool
- func ToJSON(obj interface{}) string
- func ToJson(obj interface{}) string
- type FIFO
- type SlotBitMap
- func (s *SlotBitMap) CleanSlots(slots []byte)
- func (s *SlotBitMap) ExportSlots(num int) []byte
- func (s *SlotBitMap) GetBits() []byte
- func (s *SlotBitMap) GetSlot(num uint32) bool
- func (s *SlotBitMap) GetVaildSlotNum() int
- func (s *SlotBitMap) GetVaildSlots() []uint32
- func (s *SlotBitMap) MergeSlots(bs ...[]byte)
- func (s *SlotBitMap) Reset()
- func (s *SlotBitMap) SetSlot(num uint32, v bool)
- func (s *SlotBitMap) SetSlotForRange(start, end uint32, v bool)
- type WaitGroupWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
AesDecrypt AesDecrypt
func AesDecryptPkcs5 ¶
AesDecryptPkcs5 解密
func AesDecryptPkcs7 ¶
AesDecryptPkcs7 解密
func AesDecryptPkcs7Base64 ¶
AesDecryptPkcs7Base64 解密
func AesDecryptSimple ¶
AesDecryptSimple 解密
func AesEncrypt ¶
func AesEncrypt(origData []byte, key []byte, iv []byte, paddingFunc func([]byte, int) []byte) ([]byte, error)
AesEncrypt AesEncrypt
func AesEncryptPkcs5 ¶
AesEncryptPkcs5 加密
func AesEncryptPkcs7 ¶
AesEncryptPkcs7 加密
func AesEncryptPkcs7Base64 ¶
AesEncryptPkcs7Base64
func AesEncryptSimple ¶
AesEncryptSimple 加密
func ArrayContains ¶
ArrayContains ArrayContains
func GetCurve25519Key ¶
GetCurve25519Key GetCurve25519Key
func GetCurve25519KeypPair ¶
func GetCurve25519KeypPair() (Aprivate, Apublic [32]byte)
GetCurve25519KeypPair GetCurve25519KeypPair
func PKCS5Padding ¶
PKCS5Padding PKCS5Padding
func PKCS7Padding ¶
PKCS7Padding PKCS7Padding
func ReadJsonByByte ¶
func RemoveRepeatedElement ¶
Types ¶
type SlotBitMap ¶
type SlotBitMap struct {
// contains filtered or unexported fields
}
SlotBitMap SlotBitMap
func NewSlotBitMapWithBits ¶
func NewSlotBitMapWithBits(bits []byte) *SlotBitMap
NewSlotBitMapWithBits NewSlotBitMapWithBits
func (*SlotBitMap) ExportSlots ¶
func (s *SlotBitMap) ExportSlots(num int) []byte
ExportSlots ExportSlots
func (*SlotBitMap) GetVaildSlotNum ¶
func (s *SlotBitMap) GetVaildSlotNum() int
GetVaildSlotNum GetVaildSlotNum
func (*SlotBitMap) GetVaildSlots ¶
func (s *SlotBitMap) GetVaildSlots() []uint32
GetVaildSlots GetVaildSlots
func (*SlotBitMap) SetSlotForRange ¶
func (s *SlotBitMap) SetSlotForRange(start, end uint32, v bool)
SetSlotForRange SetSlotForRange [start,end]
type WaitGroupWrapper ¶
type WaitGroupWrapper struct { sync.WaitGroup Name string // contains filtered or unexported fields }
WaitGroupWrapper waitGroup的包装结构体
func NewWaitGroupWrapper ¶
func NewWaitGroupWrapper(name string) *WaitGroupWrapper
NewWaitGroupWrapper NewWaitGroupWrapper
func (*WaitGroupWrapper) GoroutineCount ¶
func (w *WaitGroupWrapper) GoroutineCount() int64
GoroutineCount 协程数量