Documentation ¶
Index ¶
- Variables
- func AESBase64Decrypt(encrypt_data string, key string, iv []byte) (string, error)
- func AESBase64Encrypt(origin_data string, key string, iv []byte) (base64_result string, err error)
- func AESDecrypt(data string, key string) string
- func AESEncrypt(data string, key string) string
- func AddSpaceBetweenCharsAndNumbers(src string) string
- func AddString(s ...string) string
- func AddStringBytes(s ...string) []byte
- func AesDecrypt(encrypted []byte, key []byte) ([]byte, error)
- func AesDecryptEcb(crypted, key string) (string, error)
- func AesEncrypt(origData []byte, key []byte) ([]byte, error)
- func AesEncryptEcb(src, key string) (string, error)
- func ArrayInt2Str(data []int) []string
- func ArrayStr2Int(data []string) []int
- func Base64Decode(str string) string
- func Base64Encode(str string) string
- func Basename(file string) string
- func BytePos(s string, bt byte) int
- func CenterJustin(text string, size int) string
- func CheckSqlValidate(content string) (bool, string)
- func ChineseLength(str string) int
- func ClearUtf8BOM(bomStr string) string
- func Clone(src interface{}, dst interface{})
- func CmdExec(name string, arg ...string) (string, error)
- func CmdRunWithTimeout(cmd *exec.Cmd, timeout time.Duration) (error, bool)
- func CompactJSON(in string) string
- func Compress(data []byte) ([]byte, error)
- func ConvertDateFormat(timeStr string, format string) string
- func DBCtoSBC(s string) string
- func DESDecrypt(data string, key string) string
- func DESDecryptECB(data string, key string) string
- func DESEncrypt(data string, key string) string
- func DESEncryptECB(data string, key string) string
- func DateFormat(t time.Time, format string) string
- func DecodeXMLToMap(r io.Reader) (m map[string]string, err error)
- func Decompress(data []byte) ([]byte, error)
- func DefaultIfNil(value interface{}, defaultValue interface{}) interface{}
- func DeleteArray(src []interface{}, index int) (result []interface{})
- func DesDecrypt(crypted, key []byte) ([]byte, error)
- func DesEcbDecrypt(src, key []byte) ([]byte, error)
- func DesEcbEncrypt(src, key []byte) ([]byte, error)
- func DesEncrypt(origData, key []byte) ([]byte, error)
- func DifferenceStringSlice(slice1, slice2 []string) []string
- func Dir(file string) string
- func DirsUnder(dirPath string) ([]string, error)
- func DisplaySize(raw float64) string
- func DownloadFile(fileUrl, localPath string) (string, error)
- func EncodeXMLFromMap(w io.Writer, m map[string]string, rootname string) (err error)
- func Existi(src map[string]interface{}, key string) bool
- func Exists(src map[string]string, key string) bool
- func Ext(file string) string
- func FileMD5(filename string) (string, error)
- func FileMTime(file string) (int64, error)
- func FileSha256(filename string) (string, error)
- func FileSize(file string) (int64, error)
- func FilesUnder(dirPath string) ([]string, error)
- func FirstNonNil(values ...interface{}) interface{}
- func Float64ArrayContains(src []float64, dst float64) bool
- func Float64ArrayDelete(src []float64, index int) []float64
- func FromJSON(j string, o interface{}) *interface{}
- func GbkToUtf8(gbkStr string) (string, error)
- func GenerateRandString(source string, l int) string
- func Get0Hour(t time.Time) time.Time
- func Get0LastMonth(t time.Time) time.Time
- func Get0LastWeek(t time.Time) time.Time
- func Get0Minute(t time.Time) time.Time
- func Get0Month(t time.Time) time.Time
- func Get0NextMonth(t time.Time) time.Time
- func Get0NextWeek(t time.Time) time.Time
- func Get0Second(t time.Time) time.Time
- func Get0Tomorrow(t time.Time) time.Time
- func Get0Week(t time.Time) time.Time
- func Get0Yesterday(t time.Time) time.Time
- func GetDate() string
- func GetGoroutineID() uint64
- func GetIPv4ByInterface(name string) ([]string, error)
- func GetLocalIpAddress() (ip string)
- func GetMonthDays(t time.Time) int
- func GetNowDateTime() string
- func GetRandomCaseString(l int) string
- func GetRandomHexString(l int) string
- func GetRandomIntString(l int) string
- func GetRandomString(l int) string
- func GetStructFields(obj interface{}) []string
- func GetStructJsonTags(obj interface{}) []string
- func GetUUIDString() string
- func GinHeaders(c *gin.Context) map[string]string
- func GinParamMap(c *gin.Context) map[string]string
- func GormTimeFormat(t string) string
- func HmacSHA1(key string, data string) []byte
- func HmacSHA1Base64(key string, data string) string
- func HmacSHA1Hex(key string, data string) string
- func HmacSHA256(key string, data string) []byte
- func HmacSHA256Base64(key string, data string) string
- func HmacSHA256Hex(key string, data string) string
- func IfThen(condition bool, a interface{}) interface{}
- func IfThenElse(condition bool, a interface{}, b interface{}) interface{}
- func InsureDir(path string) error
- func Int64Unique(a []int64) []int64
- func IntArrayContains(src []int, dst int) bool
- func IntArrayDelete(src []int, index int) []int
- func IntersectStringSlice(slice1, slice2 []string) []string
- func IsAlphaNum(c uint8) bool
- func IsAlphabet(char uint8) bool
- func IsBlank(text string) bool
- func IsBlankBytes(bs []byte) bool
- func IsChinaMobile(b []byte) bool
- func IsChinaMobileString(s string) bool
- func IsChinese(str string) bool
- func IsChineseName(b []byte) bool
- func IsChineseNameEx(b []byte) ([]byte, bool)
- func IsChineseNameString(s string) bool
- func IsChineseNameStringEx(s string) (string, bool)
- func IsDir(s string) bool
- func IsEmpty(text string) bool
- func IsEndOf(s, sub string) bool
- func IsExist(path string) bool
- func IsFile(filePath string) bool
- func IsIdCard(cardNo string) bool
- func IsIntranetIP(ip string) bool
- func IsMail(b []byte) bool
- func IsMailString(s string) bool
- func IsMark(r rune) bool
- func IsNickname(b []byte) bool
- func IsNicknameString(s string) bool
- func IsNotBlank(text string) bool
- func IsNotEmpty(text string) bool
- func IsNumeric(c byte) bool
- func IsPortUse(port int) bool
- func IsSpace(c byte) bool
- func IsSpaceRune(r rune) bool
- func IsStartOf(s, sub string) bool
- func IsUserName(b []byte) bool
- func IsUserNameString(s string) bool
- func IsValidUUIDString(s string) bool
- func JSONPretty(in, prefix, indent string) string
- func Left(src string, size int) string
- func LeftJustin(text string, size int) string
- func Length(text string) int
- func LocalIPv4s() ([]string, error)
- func LowerFirst(s string) string
- func Lowercase(s string) string
- func MD5Encode(content string) (md string)
- func MapItoS(src map[string]interface{}) map[string]string
- func MapMD5(m map[string]string) string
- func MapStoI(src map[string]string) map[string]interface{}
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func NewSafeGo(argsF func(args ...interface{})) *safeGo
- func NewUUIDString() string
- func PKCS5Padding(cipherText []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) ([]byte, error)
- func PriKeyDecrypt(data, privateKey string) (string, error)
- func PriKeyEncrypt(data, privateKey string) (string, error)
- func PublicDecrypt(data, publicKey string) (string, error)
- func PublicEncrypt(data, publicKey string) (string, error)
- func ReadFileToBytes(filePath string) ([]byte, error)
- func ReadFileToString(filePath string) (string, error)
- func RealPath(file string) (string, error)
- func Rename(file string, to string) error
- func ReplacePunctuation(src, replaceWith string) string
- func ReplacePunctuationWithSpace(src string) string
- func Right(src string, size int) string
- func RightJustin(text string, size int) string
- func RunePos(s string, ru rune) int
- func SearchFile(filename string, paths ...string) (fullPath string, err error)
- func SelfDir() string
- func SelfPath() string
- func SftpClose(sftpClient *sftp.Client, sshClient *ssh.Client)
- func SftpConnect(user, password, host string, port int) (*sftp.Client, *ssh.Client, error)
- func SftpUploadFile(sftpClient *sftp.Client, localFilePath string, remotePath string)
- func Sha1(src string) string
- func Sha256(src string) string
- func SimpleUUID() string
- func SliceContains(sl []interface{}, v interface{}) bool
- func SliceContainsInt(sl []int, v int) bool
- func SliceContainsInt64(sl []int64, v int64) bool
- func SliceContainsString(sl []string, v string) bool
- func SliceMerge(slice1, slice2 []interface{}) (c []interface{})
- func SliceMergeInt(slice1, slice2 []int) (c []int)
- func SliceMergeInt64(slice1, slice2 []int64) (c []int64)
- func SliceMergeString(slice1, slice2 []string) (c []string)
- func SliceSumFloat64(intslice []float64) (sum float64)
- func SliceSumInt(intslice []int) (sum int)
- func SliceSumInt64(intslice []int64) (sum int64)
- func SliceUniqueInt(s []int) []int
- func SliceUniqueInt64(s []int64) []int64
- func SliceUniqueString(s []string) []string
- func StrPos(s, sub string) int
- func StringArrayContains(src []string, dst string) bool
- func StringArrayDelete(src []string, index int) []string
- func StringUnique(a []string) []string
- func Struct2Map(obj interface{}) map[string]interface{}
- func StructJsonTagToMap(obj interface{}) map[string]interface{}
- func SubChineseString(str string, begin, length int) string
- func TimeSubDays(t1, t2 time.Time) int
- func ToDateString(date time.Time) string
- func ToDateTimeString(date time.Time) string
- func ToJSON(o interface{}) string
- func ToTimeString(date time.Time) string
- func TrimEmoji(s string) string
- func TrimSpaceStrInArray(str string, data []string) bool
- func TripleDESDecrypt(data string, key string, pcks5padding bool) string
- func TripleDESEncrypt(data string, key string, pcks5padding bool) string
- func TripleDesDecrypt(crypted, key []byte, pcks5padding bool) ([]byte, error)
- func TripleDesEncrypt(origData, key []byte, pcks5padding bool) ([]byte, error)
- func TripleEcbDesDecrypt(crypted, key []byte) ([]byte, error)
- func TripleEcbDesEncrypt(origData, key []byte) ([]byte, error)
- func UnSplitString(src []string, sep string) string
- func UnicodeEmojiCode(s string) string
- func UnicodeEmojiDecode(s string) string
- func UnionStringSlice(slice1, slice2 []string) []string
- func Unlink(file string) error
- func UpperFirst(s string) string
- func UpperWord(s string) string
- func Uppercase(s string) string
- func UrlDecode(encoded string) (string, error)
- func UrlEncode(rawString string) string
- func Utf8ToGbk(uft8Str string) string
- func Utf8len(s string) int
- func ValidUtf8String(s string) bool
- func WaitNextMinute()
- func WeekByDate(t time.Time) int
- func WriteBytesToFile(filePath string, b []byte) (int, error)
- func WriteStringToFile(filePath string, s string) (int, error)
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
- func ZipFiles(filename string, files []string, srcpath string, aliasnames []string) error
- type EscapeError
- type HashSet
- type Pair
- type PairList
- type RSASecurity
- func (rsas *RSASecurity) GetPrivatekey() (*rsa.PrivateKey, error)
- func (rsas *RSASecurity) GetPublickey() (*rsa.PublicKey, error)
- func (rsas *RSASecurity) PriKeyDECRYPT(input []byte) ([]byte, error)
- func (rsas *RSASecurity) PriKeyENCTYPT(input []byte) ([]byte, error)
- func (rsas *RSASecurity) PubKeyDECRYPT(input []byte) ([]byte, error)
- func (rsas *RSASecurity) PubKeyENCTYPT(input []byte) ([]byte, error)
- func (rsas *RSASecurity) SetPrivateKey(priStr string) (err error)
- func (rsas *RSASecurity) SetPublicKey(pubStr string) (err error)
- func (rsas *RSASecurity) SignSha1WithRsa(data string) (string, error)
- func (rsas *RSASecurity) SignSha256WithRsa(data string) (string, error)
- func (rsas *RSASecurity) SignSha256WithRsaHex(data string) (string, error)
- func (rsas *RSASecurity) SignSha256WithRsaUrlSafe(data string) (string, error)
- func (rsas *RSASecurity) VerifySignSha1WithRsa(data string, signData string) error
- func (rsas *RSASecurity) VerifySignSha256WithRsa(data string, signData string) error
- type UUID
- type WeekDate
Constants ¶
This section is empty.
Variables ¶
var ( ErrDataToLarge = errors.New("message too long for RSA public key size") ErrDataLen = errors.New("data length error") ErrDataBroken = errors.New("data broken, first byte is not zero") ErrKeyPairDismatch = errors.New("data is not encrypted by the private key") ErrDecryption = errors.New("decryption error") ErrPublicKey = errors.New("get public key error") ErrPrivateKey = errors.New("get private key error") )
var RSA = &RSASecurity{}
var (
UUIDSnippet = block1 + "-" + block2 + "-" + block3 + "-" + block4 + "-" + block5
)
regex for validating that the UUID matches RFC 4122. This package generates version 4 UUIDs but accepts any UUID version. http://www.ietf.org/rfc/rfc4122.txt
Functions ¶
func AESBase64Decrypt ¶
func AESBase64Encrypt ¶
func AESDecrypt ¶
func AESEncrypt ¶
func AddStringBytes ¶
AddStringBytes 拼接字符串, 返回 bytes from bytes.Join()
func AesDecryptEcb ¶
func AesEncryptEcb ¶
func Base64Decode ¶
func Base64Encode ¶
func CenterJustin ¶
Center justifies the text in the center
func CheckSqlValidate ¶
CheckSqlValidate 检查是否含有可能产生注入的非法字符 返回值为true时表示含有非法字符,同时返回的字符串值为匹配到的非法字符
func ChineseLength ¶
func ClearUtf8BOM ¶
func CompactJSON ¶
CompactJSON compact json input with insignificant space characters elided
func ConvertDateFormat ¶
func DESDecrypt ¶
func DESDecryptECB ¶
func DESEncrypt ¶
func DESEncryptECB ¶
func DateFormat ¶
Format time.Time struct to string MM - month - 01 M - month - 1, single bit DD - day - 02 D - day 2 YYYY - year - 2006 YY - year - 06 HH - 24 hours - 03 H - 24 hours - 3 hh - 12 hours - 03 h - 12 hours - 3 mm - minute - 04 m - minute - 4 ss - second - 05 s - second = 5
func DecodeXMLToMap ¶
DecodeXMLToMap decodes xml reading from io.Reader and returns the first-level sub-node key-value set, if the first-level sub-node contains child nodes, skip it.
func Decompress ¶
Decompress returns the decompressed bytes
func DefaultIfNil ¶
func DefaultIfNil(value interface{}, defaultValue interface{}) interface{}
DefaultIfNil checks if the value is nil, if true returns the default value otherwise the original
func DesDecrypt ¶
func DesEcbDecrypt ¶
func DesEcbEncrypt ¶
func DesEncrypt ¶
func DifferenceStringSlice ¶
求差集 slice1-并集
func DisplaySize ¶
func DownloadFile ¶
func EncodeXMLFromMap ¶
EncodeXMLFromMap encodes map[string]string to io.Writer with xml format.
NOTE: This function requires the rootname argument and the keys of m (type map[string]string) argument are legitimate xml name string that does not contain the required escape character!
func FileSha256 ¶
func FirstNonNil ¶
func FirstNonNil(values ...interface{}) interface{}
FirstNonNil returns the first non nil parameter
func Float64ArrayContains ¶
func Float64ArrayDelete ¶
func GenerateRandString ¶
func GetGoroutineID ¶
func GetGoroutineID() uint64
func GetIPv4ByInterface ¶
GetIPv4ByInterface return IPv4 address from a specific interface IPv4 addresses
func GetLocalIpAddress ¶
func GetLocalIpAddress() (ip string)
func GetNowDateTime ¶
func GetNowDateTime() string
func GetRandomCaseString ¶
func GetRandomHexString ¶
func GetRandomIntString ¶
func GetRandomString ¶
func GetStructFields ¶
func GetStructFields(obj interface{}) []string
func GetStructJsonTags ¶
func GetStructJsonTags(obj interface{}) []string
func GetUUIDString ¶
func GetUUIDString() string
func GormTimeFormat ¶
func HmacSHA1Base64 ¶
func HmacSHA1Hex ¶
func HmacSHA256 ¶
func HmacSHA256Base64 ¶
func HmacSHA256Hex ¶
func IfThen ¶
func IfThen(condition bool, a interface{}) interface{}
IfThen evaluates a condition, if true returns the parameters otherwise nil
func IfThenElse ¶
func IfThenElse(condition bool, a interface{}, b interface{}) interface{}
IfThenElse evaluates a condition, if true returns the first parameter otherwise the second
func IntArrayContains ¶
func IntArrayDelete ¶
func IsAlphaNum ¶
IsAlphaNum reports whether the byte is an ASCII letter, number, or underscore
func IsBlankBytes ¶
IsBlankBytes returns true if the given []byte is all space characters.
func IsChinaMobile ¶
检验是否为合法的中国手机号, 不是那么太精细 只要是 13,14,15,18 开头的 11 位数字就认为是中国手机号
func IsChinaMobileString ¶
同 func IsChinaMobile(b []byte) bool
func IsChineseNameEx ¶
IsChineseNameEx 检验是否为有效的中文姓名(比如 张三, 李四, 张三·李四), 主要功能和 IsChineseName 相同, 但是如果姓名中包含不规范的间隔符, 会自动修正为正确的间隔符 '\u00B7', 并返回正确的结果.
func IsChineseNameStringEx ¶
同 IsChineseNameEx(b []byte) ([]byte, bool)
func IsExist ¶
IsExist checks whether a file or directory exists. It returns false when the file or directory does not exist.
func IsFile ¶
IsFile checks whether the path is a file, it returns false when it's a directory or does not exist.
func IsIntranetIP ¶
func IsMail ¶
检验是否为合法的电子邮箱, 考虑到各个网站的 mail 要求不一样, 这里匹配比较宽松 邮箱用户名可以包含 0-9, A-Z, a-z, -, _, . 开头字母不能是 -, _, . 结尾字母不能是 -, _, . -, _, . 这三个连接字母任意两个不能连续, 如不能出现 --, __, .., -_, -., _. 邮箱的域名可以包含 0-9, A-Z, a-z, - 连接字符 - 只能出现在中间, 不能连续, 如不能 -- 支持多级域名, x@y.z, x@y.z.w, x@x.y.z.w.e
func IsNickname ¶
检验是否为合法的昵称, 合法的字符有 0-9, A-Z, a-z, _, 汉字 字符 '_' 只能出现在中间且不能重复, 如 "__"
func IsNotBlank ¶
IsNotBlank returns true if the string is not blank
func IsNotEmpty ¶
IsNotEmpty returns true if the string is not empty
func IsSpaceRune ¶
IsSpaceRune returns true if the given rune is a space, otherwise false.
func IsUserName ¶
检验是否为合法的用户名, 合法的字符有 0-9, A-Z, a-z, _ 第一个字母不能为 _, 0-9 最后一个字母不能为 _, 且 _ 不能连续
func IsValidUUIDString ¶
IsValidUUIDString returns true, if the given string matches a valid UUID (version 4, variant 2).
func JSONPretty ¶
JSONPrettyPrint pretty print raw json string to indent string
func LocalIPv4s ¶
LocalIPs return all non-loopback IPv4 addresses
func NewECBDecrypter ¶
NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.
func NewECBEncrypter ¶
NewECBEncrypter returns a BlockMode which encrypts in electronic code book mode, using the given Block.
func NewSafeGo ¶ added in v1.1.16
func NewSafeGo(argsF func(args ...interface{})) *safeGo
NewSafeGo 创建一个安全的协程调用
示例: safeGo := NewSafeGo(func(args ...interface{}) { }) safeGo.SetGoBeforeHandler(func() map[string]interface{} { return map[string]interface{}{ "preRoutineId": "123", } }) safeGo.SetCallBeforeHandler(func(params map[string]interface{}) { fmt.Println(params["preRoutineId"]) }) safeGo.Run("hello", "world")
func NewUUIDString ¶
func NewUUIDString() string
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func ReadFileToBytes ¶
ReadFileToBytes reads data type '[]byte' from file by given path. It returns error when fail to finish operation.
func ReadFileToString ¶
ReadFileToString reads data type 'string' from file by given path. It returns error when fail to finish operation.
func ReplacePunctuation ¶
func RightJustin ¶
Right justifies the text to the right
func SearchFile ¶
Search a file in paths. this is often used in search config file in /etc ~/
func SftpConnect ¶
func SftpUploadFile ¶
func SimpleUUID ¶
func SimpleUUID() string
func SliceContains ¶
func SliceContains(sl []interface{}, v interface{}) bool
func SliceContainsInt ¶
func SliceContainsInt64 ¶
func SliceContainsString ¶
func SliceMerge ¶
func SliceMerge(slice1, slice2 []interface{}) (c []interface{})
SliceMerge merges interface slices to one slice.
func SliceMergeInt ¶
func SliceMergeInt64 ¶
func SliceMergeString ¶
func SliceSumFloat64 ¶
func SliceSumInt ¶
func SliceSumInt64 ¶
func SliceUniqueInt ¶
func SliceUniqueInt64 ¶
func SliceUniqueString ¶
func StringArrayContains ¶
func StringArrayDelete ¶
func SubChineseString ¶
func TimeSubDays ¶
func ToDateString ¶
func ToDateTimeString ¶
func ToTimeString ¶
func TrimSpaceStrInArray ¶
str[TrimSpace] in string list
func TripleDesDecrypt ¶
3DES解密
func TripleDesEncrypt ¶
3DES加密
func TripleEcbDesDecrypt ¶
[golang ECB 3DES Decrypt]
func TripleEcbDesEncrypt ¶
[golang ECB 3DES Encrypt]
func UnSplitString ¶
func UnionStringSlice ¶
func WriteBytesToFile ¶
WriteBytesToFile saves content type '[]byte' to file by given path. It returns error when fail to finish operation.
func WriteStringToFile ¶
WriteStringFile saves content type 'string' to file by given path. It returns error when fail to finish operation.
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
type EscapeError ¶
type EscapeError string
func (EscapeError) Error ¶
func (e EscapeError) Error() string
type HashSet ¶
type HashSet struct {
// contains filtered or unexported fields
}
func NewHashSet ¶
func NewHashSet() *HashSet
type RSASecurity ¶
type RSASecurity struct {
// contains filtered or unexported fields
}
func (*RSASecurity) GetPrivatekey ¶
func (rsas *RSASecurity) GetPrivatekey() (*rsa.PrivateKey, error)
*rsa.PublicKey
func (*RSASecurity) GetPublickey ¶
func (rsas *RSASecurity) GetPublickey() (*rsa.PublicKey, error)
*rsa.PrivateKey
func (*RSASecurity) PriKeyDECRYPT ¶
func (rsas *RSASecurity) PriKeyDECRYPT(input []byte) ([]byte, error)
私钥解密
func (*RSASecurity) PriKeyENCTYPT ¶
func (rsas *RSASecurity) PriKeyENCTYPT(input []byte) ([]byte, error)
私钥加密
func (*RSASecurity) PubKeyDECRYPT ¶
func (rsas *RSASecurity) PubKeyDECRYPT(input []byte) ([]byte, error)
公钥解密
func (*RSASecurity) PubKeyENCTYPT ¶
func (rsas *RSASecurity) PubKeyENCTYPT(input []byte) ([]byte, error)
公钥加密
func (*RSASecurity) SetPrivateKey ¶
func (rsas *RSASecurity) SetPrivateKey(priStr string) (err error)
设置私钥
func (*RSASecurity) SetPublicKey ¶
func (rsas *RSASecurity) SetPublicKey(pubStr string) (err error)
设置公钥
func (*RSASecurity) SignSha1WithRsa ¶
func (rsas *RSASecurity) SignSha1WithRsa(data string) (string, error)
*
- 使用RSAWithSHA1算法签名
func (*RSASecurity) SignSha256WithRsa ¶
func (rsas *RSASecurity) SignSha256WithRsa(data string) (string, error)
*
- 使用RSAWithSHA256算法签名
func (*RSASecurity) SignSha256WithRsaHex ¶
func (rsas *RSASecurity) SignSha256WithRsaHex(data string) (string, error)
func (*RSASecurity) SignSha256WithRsaUrlSafe ¶
func (rsas *RSASecurity) SignSha256WithRsaUrlSafe(data string) (string, error)
func (*RSASecurity) VerifySignSha1WithRsa ¶
func (rsas *RSASecurity) VerifySignSha1WithRsa(data string, signData string) error
*
- 使用RSAWithSHA1验证签名
func (*RSASecurity) VerifySignSha256WithRsa ¶
func (rsas *RSASecurity) VerifySignSha256WithRsa(data string, signData string) error
*
- 使用RSAWithSHA256验证签名
type UUID ¶
type UUID [16]byte
UUID represent a universal identifier with 16 octets.
func MustNewUUID ¶
func MustNewUUID() UUID
MustNewUUID returns a new uuid, if an error occurs it panics.
func UUIDFromString ¶
Source Files ¶
- 3desutil.go
- aesutil.go
- base64util.go
- checkutil.go
- chineseutil.go
- conditionutil.go
- desutil.go
- downloadutil.go
- emojiutil.go
- fileutil.go
- ginutil.go
- hashset.go
- hmacutil.go
- iputil.go
- jsonutil.go
- maputil.go
- md5util.go
- randutil.go
- routineutil.go
- rsautil.go
- safego.go
- sftputil.go
- shautil.go
- sizeutil.go
- sliceutil.go
- sqlvalidate.go
- stringutil.go
- structutil.go
- sysutil.go
- timeutil.go
- urlutil.go
- utf8gbkutil.go
- uuidutil.go
- xmlutil.go
- ziputil.go