物联卡

This commit is contained in:
suyl
2021-07-19 16:56:29 +08:00
parent 4f68cf371c
commit 37aa0e632e
3 changed files with 149 additions and 37 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/sha1"
"encoding/base64"
"fmt"
"git.rosy.net.cn/baseapi/utils"
@@ -768,14 +769,8 @@ func TestUpdateStatus(t *testing.T) {
//fmt.Println(int2h8l8(int64(len("fd003401005b76325dc8d5d5d5cfe3c2afc9fad7cfd1cca3acd2a3bfb4c6d9b2bcb9d2c7b0b4a8a3acb7c9c1f7d6b1cfc2c8fdc7a7b3dfa3acd2c9cac7d2f8bad3c2e4bec5ccec") / 2)))
//fmt.Println(hex.EncodeToString(data))
//fmt.Println(fmt.Sprintf("%x", len("fd003401005b76325dc8d5d5d5cfe3c2afc9fad7cfd1cca3acd2a3bfb4c6d9b2bcb9d2c7b0b4a8a3acb7c9c1f7d6b1cfc2c8fdc7a7b3dfa3acd2c9cac7d2f8bad3c2e4bec5ccec")/2))
str := "1e00180200015054353139444130303031375a31510001"
var sum int64
for i := 0; i < len(str); i = i + 2 {
b := string(str[i]) + string(str[i+1])
bt, _ := strconv.ParseInt(b, 16, 32)
sum += bt
}
fmt.Println(int2h8l8(sum))
str := "AA0D5ABE801F11E98489525400AE46A6e10adc3949ba59abbe56e057f20f883e"
fmt.Println(fmt.Sprintf("%x", sha1.Sum([]byte(str))))
}
func sss() (data2 []byte) {