feat:增加时分字符串转二进制方法
This commit is contained in:
parent
7c4a3a9039
commit
0c689286ad
12
format.js
12
format.js
@ -26,6 +26,18 @@ export function timestampToArray(timestamp) {
|
|||||||
array[3] = timestamp & 0xff
|
array[3] = timestamp & 0xff
|
||||||
return array
|
return array
|
||||||
}
|
}
|
||||||
|
// 时分字符串转二进制
|
||||||
|
export function parseTimeToList(timeString) {
|
||||||
|
let timeList = [0, 0, 0, 0]
|
||||||
|
|
||||||
|
if (timeString.includes(':')) {
|
||||||
|
let timeParts = timeString.split(':')
|
||||||
|
timeList[2] = parseInt(timeParts[0], 10)
|
||||||
|
timeList[3] = parseInt(timeParts[1], 10)
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Uint8Array(timeList)
|
||||||
|
}
|
||||||
|
|
||||||
// md5加密
|
// md5加密
|
||||||
export function md5Encrypt(text, token, key) {
|
export function md5Encrypt(text, token, key) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user