helper

package
v0.0.0-...-236a94d Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2018 License: MIT Imports: 18 Imported by: 4

Documentation

Index

Constants

View Source
const Digits = "0123456789"
View Source
const DigitsAndLetters = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789"

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(crypted, key, iv []byte) ([]byte, error)

AESDecrypt AES 解密

func AESEncrypt

func AESEncrypt(plaintext, key, iv []byte) ([]byte, error)

AESEncrypt AES加密

func CopyObject

func CopyObject(src, dest interface{}) error

CopyObject 复制单个对象

func CopySlice

func CopySlice(src, dest interface{}) error

CopySlice 复制数组

func GetExecDir

func GetExecDir() (dir, file string)

GetExecDir 获取当前程序运行目录

func IP2Int

func IP2Int(ip string) int64

IP2Int IP地址转换为数字

func IfTrue

func IfTrue(b bool, t, f interface{}) interface{}

IfTrue 二元运算

func IfTrueFloat

func IfTrueFloat(b bool, t, f float64) float64

IfTrueFloat 二元运算

func IfTrueInt

func IfTrueInt(b bool, t, f int) int

IfTrueInt 二元运算

func IfTrueInt64

func IfTrueInt64(b bool, t, f int64) int64

IfTrueInt64 二元运算

func IfTrueStr

func IfTrueStr(b bool, t, f string) string

IfTrueStr 二元运算

func Int2IP

func Int2IP(ipint int64) string

Int2IP 数字转换为IP V4

func Joins

func Joins(slice []interface{}, delim string) string

Joins 根据指定连接字符串拼接数组

func MD5

func MD5(plainText []byte) string

MD5 MD5哈希加密, 返回32位字符串

func SHA1

func SHA1(plainText []byte) string

SHA1 SHA1哈希加密

Types

type IPNumber

type IPNumber int64

IPNumber 数字IP

func (IPNumber) MarshalJSON

func (ip IPNumber) MarshalJSON() ([]byte, error)

type RandomGenerator

type RandomGenerator func(int) string

RandomGenerator 随机字符串生成器

func CreateRandomGenerator

func CreateRandomGenerator(pool string) RandomGenerator

CreateRandomGenerator 创建随机字符生成器

Jump to

Keyboard shortcuts

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