Dim bc As ByteConverter
Dim bb As BytesBuilder
Dim bcc As Int
bb.Initialize
Dim c As String=""
Dim CMD() As String=Regex.Split(",",TXTMSG.Text)
bb.Append(Array As Byte(0x01))
bb.Append(Array As Byte(0x25))
bb.Append(bc.HexToBytes(Bit.ToHexString(Rnd(32,255))))
bb.Append (bc.HexToBytes("45"))
If CMD(4)="0" Then
bb.Append(bc.StringToBytes("0","UTF8"))
End If
bb.Append (bc.HexToBytes("05"))
Bit.ParseInt(bc.StringFromBytes(bb.SubArray2(3,4),"UTF-8") ,16)))
Dim pz1 As String=bc.HexFromBytes( bb.SubArray2(1,2))
Dim pz2 As String=bc.HexFromBytes( bb.SUBARRAY2(2,3))
Dim pz3 As String=bc.HexFromBytes( bb.SUBARRAY2(3,4))
Dim pz4 As String=bc.HexFromBytes( bb.SUBARRAY2(4,5))
Dim pz5 As String=bc.HexFromBytes( bb.SUBARRAY2(5,6))
Dim val As String=Bit.ToHexString( Bit.ParseInt(pz1,16)+Bit.ParseInt(pz2,16)+Bit.ParseInt(pz3,16)+Bit.ParseInt(pz4,16)+Bit.ParseInt(pz5,16))
Dim CF() As Byte=val.GetBytes("UTF8")
Log(CF.Length)
For I=0 To 3-CF.Length
bb.Append(bc.HexToBytes("30"))
Next
For J=0 To CF.Length-1
Log(CF(J))
'bb.Append(bc.HexToBytes(bc.StringToBytes( Chr(3)&CF(J),"utf8")))
Next
LBLCMD.Text= bc.HexFromBytes(bb.ToArray)