This commit is contained in:
richboo111
2022-08-04 14:31:01 +08:00
2 changed files with 5 additions and 5 deletions

View File

@@ -566,14 +566,14 @@ func int2h8l8(i int64) (h, l string) {
} }
begin8 := origin2[:8] begin8 := origin2[:8]
end8 := origin2[8:] end8 := origin2[8:]
r1, _ := strconv.ParseInt(begin8, 2, 32) r1, _ := strconv.ParseInt(begin8, 2, 64)
r2, _ := strconv.ParseInt(end8, 2, 32) r2, _ := strconv.ParseInt(end8, 2, 64)
h = fmt.Sprintf("%x", r1) h = fmt.Sprintf("%x", r1)
l = fmt.Sprintf("%x", r2) l = fmt.Sprintf("%x", r2)
if len(h) < 2 { if len(h)%2 != 0 {
h = "0" + h h = "0" + h
} }
if len(l) < 2 { if len(l)%2 != 0 {
l = "0" + l l = "0" + l
} }
return h, l return h, l

View File

@@ -17,7 +17,7 @@ func TestPrintMsg(t *testing.T) {
ModelIDCULD: model.ModelIDCULD{}, ModelIDCULD: model.ModelIDCULD{},
PrintNo: "20220707000002", PrintNo: "20220707000002",
Content: "<sound>61</sound><sound>62</sound>", Content: "<sound>61</sound><sound>62</sound>",
OrderNo: "1", OrderNo: "9999999991", // 2147483648111
Status: 0, Status: 0,
Comment: "", Comment: "",
MsgID: "1", MsgID: "1",