radar_test.go 784 B

12345678910111213141516171819202122232425262728
  1. package protocol
  2. import (
  3. "encoding/hex"
  4. "fmt"
  5. "testing"
  6. )
  7. //buf.Write([]byte{0xFE, 0x5C, 0x4B, 0x89, 0x2A, 0x00, 0x00, 0x00})
  8. //fmt.Println("buf", buf.Bytes())
  9. //
  10. //fmt.Println("转换", hex.EncodeToString(buf.Bytes()))
  11. //
  12. //reply, _ := hex.DecodeString(
  13. //"fe5c4b892a000000")
  14. //fmt.Println("reply", reply)
  15. func Test_verify(t *testing.T) {
  16. login := AuthDataPack{}.AuthLogin()
  17. //fe5c4b89 2a000000 62 00000000 17000000 31 23 32303234 30393237 3035 3137 3230 3031 23 303630 23ffff
  18. //fe5c4b89 2a000000 62 00000000 17000000 31 23 32303234 30393239 3037 3137 3237 3535 23 303630 23ffff
  19. fmt.Println("loginBuf", login.Bytes())
  20. toString := hex.EncodeToString(login.Bytes())
  21. fmt.Println("toString", toString)
  22. reply, _ := hex.DecodeString(toString)
  23. fmt.Println("reply", reply)
  24. }