# Functions
AfterStopFunc 超时停止协程,关闭协程。使用原始channel实现 这里新建了两个channel是防止关闭一个已经关闭的channel导致panic,这里还有优化点。 该函数主使用场景,比如防止扫描磁盘时间过长,在规定时间里获取结果.
AfterStopWithContext 超时停止协程,关闭协程。使用context实现.
Base64RawStdDecode base标准解码.
Base64RawStdEncode baseRaw标准编码.
Base64RawURLDecode baseRawURL解码.
Base64RawURLEncode baseRawURL编码.
Base64StdDecode base标准解码.
Base64StdEncode base标准编码.
Base64URLDecode baseURL解码.
Base64URLEncode baseURL编码.
No description provided by the author
No description provided by the author
BytesToStr []byte转string.
No description provided by the author
Contains 判断字符串是否存在切片中.
DecodePemHexBase64 解析pem或者hex或者base64编码成der编码.
DecryptByAesCBC cbc模式解密.
No description provided by the author
DecryptByRSA 使用RSA私钥解密.
DecryptByRSABytes 使用RSA私钥解密.
DecryptBySM2 使用SM2私钥解密.
No description provided by the author
No description provided by the author
EncryptByAesCBC 加密 AES-128 key长度:16, 24, 32 bytes 对应 AES-128, AES-192, AES-256.
No description provided by the author
EncryptByRSA 使用RSA公钥加密.
EncryptByRSABytes 使用RSA公钥加密.
FileCopy 复制文件,代码仅供参考.
FileExist 判断文件是否存在.
FileFindPath 获取文件名路径,首先判断文件是否可以直接访问,优先获取当前可执行文件夹下,再去找工作路径下.
FileIsBinary 判断文件是否是二进制文件.
FileIsDir 判断文件是否是目录.
FileMove 移动文件,代码仅供参考.
FileSize 获取文件大小.
FormatBinary formats bytes integer to human readable string according to IEC 60027.
FormatBinaryDecimal formats bytes integer to human readable string according to SI international system of units.
FormatByStr 将字符串中的时间变量(y年/m月/d日/h时/i分/s秒)转换成时间字符串.
FormatBytesString 格式化bytes单位成可阅读单位形式,由于电脑制造商使用的是1000为单位计算磁盘大小 所以基本上使用该函数格式化存储大小.
FormatBytesStringOhMyGod 格式化存储大小,理论上应该使用该方式格式化存储大小,但是实际上不是这样的,呜呜呜呜呜呜.
GenerateBase64Key 生成base64编码的公私钥.
GenerateECDSAKey 生成PEM格式ECDSA公私钥,写入到io.Writer中.
GenerateECDSAKeyToMemory 生成PEM格式ECDSA公私钥,返回字节格式.
GenerateRSAKey 生成PEM格式PKCS1的RSA公私钥,写入到io.Writer中.
GenerateRSAKeyToMemory 生成PEM格式PKCS1的RSA公私钥,返回字节格式.
GenerateSSHKey 生成ssh密钥队.
No description provided by the author
GetMonthRange 获得指定年份和月份的起始unix时间和截止unix时间.
GetWeek 获得星期的数字.
No description provided by the author
No description provided by the author
HMacMD5 md5摘要算法,使用hmac算法生成hash,参数salt是多参数,实现多态的行为.
HMacSha256 生成hmac256摘要.
MacAddr 获取机器mac地址,返回mac字串数组.
MD5 md5摘要算法,可以加盐,参数salt是多参数,实现多态的行为.
No description provided by the author
NewHttpReceiveFile 创建http文件接收函数.
No description provided by the author
No description provided by the author
NumericDate is a resolved Unix time.
No description provided by the author
ParseBinaryString parses human readable bytes string to bytes integer.
ParseBytes parses human readable bytes string to bytes integer.
ParseRsaPrivateKey 解析私钥,derBytes可以使用DecodePemHexBase64函数获取.
ParseRsaPublicKey 解析公钥,derBytes可以使用DecodePemHexBase64函数获取.
No description provided by the author
ParseSM2PublicKey 解析公钥,derBytes可以使用DecodePemHexBase64函数获取.
ParseStringDecimal parses human readable bytes string to bytes integer.
No description provided by the author
No description provided by the author
No description provided by the author
RandAlphaString 生成随机长度字母.
RandBytes 生成随机长度字节.
RandInt 指定范围内的随机数字.
RandInt32 指定范围内的随机数字,max必须大于min.
RandInt64 指定范围内的随机数字,max必须大于min.
RandInts 生成指定范围int类型数组.
RandLower 指定长度的随机小写字母.
RandString 生成随机长度字符串,推荐使用.
RandUpper 指定长度的随机大写字母.
Retry calls the `fn` and if it returns the error, retry to call `fn` after `interval` duration.
Round 四舍五入.
RsaPrivateDecrypt 解析rsa私钥,参数privateKeyStr必须是hex、base64或者是pem编码.
RsaPublicEncrypt Rsa公钥加密,参数publicKeyStr必须是hex、base64或者是pem编码.
No description provided by the author
No description provided by the author
No description provided by the author
SignByRSA 使用rsa私钥对象指针签名字符串,返回base64编码的license.
SignByRSABytes 使用rsa私钥签名字符串,返回base64编码的license.
SignBySM2 使用sm2私钥对象指针签名字符串,返回base64编码的license.
SignBySM2Bytes 使用sm2私钥签名字符串,返回base64编码的license.
SM2PublicEncrypt sm2公钥加密,参数publicKeyStr必须是hex、base64或者是pem编码.
StringReplaceIgnoreCase 忽略大小写替换字符串.
StrToBytes string转[]byte.
TimestampToStr Timestamp将unix时间转为时间字符串.
TimeToStr 返回时间的字符串格式.
No description provided by the author
VerifyByRSA 使用rsa公钥验证签名的license.
VerifyBySM2 使用sm2公钥验证签名的license.
VerifyJwtSign verify jwt sign text , key is hmac key or rsa/ecdsa public key.
No description provided by the author
No description provided by the author
No description provided by the author
WithContext stops retrying when the context is done.
WithReceiveFileDstDir 接收文件夹路径,默认是当前工作路径.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithReceiveFileMaxReceiveSize 最小单位是字节Bytes.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
1 EiB = 1152921504606846976 Bytes.
No description provided by the author
1 GiB = 1073741824 Bytes.
No description provided by the author
1 KiB = 1024 Bytes.
No description provided by the author
No description provided by the author
1 MiB = 1048576 Bytes.
No description provided by the author
No description provided by the author
1 PiB = 1125899906842624 Bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
1 TiB = 1099511627776 Bytes.
# Variables
Epoch is 01/01/1970.
ErrECDSANilPubKey is the error for trying to verify a JWT with a nil public key.
ErrECDSAVerification is the error for an invalid ECDSA signature.
ErrHmacVerification is the error for an invalid RSA signature.
ErrMalformed indicates a token doesn't have a valid format, as per the RFC 7519.
ErrNotJSONObject is the error for when a JWT payload is not a JSON object.
ErrRSANilPubKey is the error for trying to verify a JWT with a nil public key.
ErrRSAVerification is the error for an invalid RSA signature.
No description provided by the author
# Structs
GobEncoder encodes cookie values using encoding/gob.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Payload is a JWT payload according to the RFC 7519.
Time is the allowed format for time, as per the RFC 7519.
# Interfaces
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
Audience is a special claim that may either be a single string or an array of strings, as per the RFC 7519.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author