easy and simple 8583 Protocol Analysis by go Language
it's so easy,and support UnionPay, signin and qrcode deal
How to use?
` func main() {
fmt.Println("test...")
up := NewUp8583()
//params setup
up.Setup("888888888888888", "12345678", "11111111111111111111111111111111", "6005010000")
//up.Frame8583QD()
//recvstr := "007960000001386131003111080810003800010AC0001450021122130107200800085500323231333031343931333239303039393939393930363030313433303137303131393939390011000005190030004046F161A743497B32EAC760DF5EA57DF5900ECCE3977731A7EA402DDF0000000000000000CFF1592A"
//recv := utils.HexStringToBytes(recvstr)
//ret := up.Ea.Ans8583Fields(recv, len(recv))
//if ret == 0 {
// fmt.Println("解析成功")
// up.Ea.PrintFields(up.Ea.Field_R)
// } else {
// fmt.Println("解析失败")
// }
up.Frame8583QD()
up.Ea.PrintFields(up.Ea.Field_S)
//
//fmt.Println(utils.BytesToHexString(up.Ea.Txbuf))
//rxbuf, err := utils.UpHttpsPost(Url, up.Ea.Txbuf)
// err = up.Ans8583QD(rxbuf, rxlen)
// if err == nil {
// log.Println("签到成功")
// }
up.Frame8583Qrcode("6220485073630469936", 1, 1)
up.Ea.PrintFields(up.Ea.Field_S)
} `
PS D:\GOPATH\src\go8583> go run demo.go
test... ans 8583 fields 解析成功 Print fields...
//==========================================
Len: 0079 Tpdu: 6005010000 Head: 613100311108 Msge: 0810 Bitmap: 003800010ac00014
//==========================================
[field:11] [500211]
[field:12] [221301]
[field:13] [0720]
[field:32] [len:08] [00085500]
[field:37] [323231333031343931333239]
[field:39] [3030]
[field:41] [3939393939393036]
[field:42] [303031343330313730313139393939]
[field:60] [len:0011] [000005190030]
[field:62] [len:0040] [46f161a743497b32eac760df5ea57df5900ecce3977731a7ea402ddf0000000000000000cff1592a]
pack 8583 fields Print fields...
//==========================================
Len: 0057 Tpdu: 6005010000 Head: 613100311108 Msge: 0800 Bitmap: 003800010ac00016
//==========================================
[field:11] [000001]
[field:41] [3334333836303133]
[field:42] [383938343330343431313130303132]
[field:60] [len:0011] [000000000030]
[field:62] [len:0025] [53657175656e6365204e6f3132333036303334333836303133]
[field:63] [len:0003] [303031]
005760050100006131003111080800003800010ac0001400000133343338363031333839383433303434313131303031320011000000000030002553657175656e6365204e6f31323330363033343338363031330003303031