工具辅助类方法
- Source
Methods
(static) asciiToHex(str)
ASCII可视字符串转小写十六进制字符串
Parameters:
Name | Type | Description |
---|---|---|
str | string | ASCII可视字符串 |
- Source
Returns:
小写十六进制字符串
(static) base64ToUtf8(str)
Base64解码转UTF8字符串
Parameters:
Name | Type | Description |
---|---|---|
str | string | Base64编码字符串 |
- Source
Returns:
UTF8字符串 遇到异常返回参数原数据
(static) cosDataSW(data) → {number}
获取COS应答数据末尾SW十进制错误码
Parameters:
Name | Type | Description |
---|---|---|
data | string | COS应答HEX数据 |
- Source
Returns:
- Type:
- number
(static) deepFreeze()
深度递归冻结对象
- Source
(static) getChars(char, count) → {string}
获取指定数量重复字符
Parameters:
Name | Type | Description |
---|---|---|
char | string | 字符 |
count | number | 重复数量 |
- Source
Returns:
- Type:
- string
(static) hexToAscii(hex)
十六进制字符串转ASCII可视字符串
Parameters:
Name | Type | Description |
---|---|---|
hex | string | 十六进制字符串 |
- Source
Returns:
ASCII可视字符串
(static) hexToUtf8(hex)
十六进制字符串转UTF8字符串
Parameters:
Name | Type | Description |
---|---|---|
hex | string | 十六进制字符串 |
- Source
Returns:
UTF8字符串
(static) sliceCount(str, count) → {Array}
依据字符数量切片字符串
Parameters:
Name | Type | Description |
---|---|---|
str | string | 完整字符串 |
count | number | 字符数量 |
- Source
Returns:
切片后的字符串数组
- Type:
- Array
(static) sliceCountToInt(str, count, radix) → {Array}
依据字符数量切片字符串并进制转换为数值
Parameters:
Name | Type | Description |
---|---|---|
str | string | 完整字符串 |
count | number | 字符数量 |
radix | number | 字符串的进制 |
- Source
Returns:
切片后的数值数组
- Type:
- Array
(static) trimHex(str) → {string}
修剪清理影响HEX字符串的格式美化字符
Parameters:
Name | Type | Description |
---|---|---|
str | string |
- Source
Returns:
- Type:
- string
(static) uint32Add()
32位无符号数加法运算
- Source
(static) uint32Mul()
32位无符号数乘法运算
- Source
(static) uint32Sub()
32位无符号数减法运算
- Source
(static) utf8ToBase64(str)
UTF8字符串转Base64编码
Parameters:
Name | Type | Description |
---|---|---|
str | string | UTF8字符串 |
- Source
Returns:
Base64编码字符串 遇到异常返回参数原数据
(static) utf8ToHex(str)
UTF8字符串转小写十六进制字符串
Parameters:
Name | Type | Description |
---|---|---|
str | string | UTF8字符串 |
- Source
Returns:
小写十六进制字符串