I've got a sub in my comms service module that constructs packets for sending via Asynchstreams.
I calculate a checksum for the data portion like this:
I'm finding in some cases that this portion of code can take up to 20 seconds to run with a packet size of 4000 bytes. Why so slow, and is there any way I can speed it up? thanks.
I calculate a checksum for the data portion like this:
B4X:
Log("preparing checksum")
Do While cnt < sz-1
oChk(0) = Bit.Xor(oChk(0),oData(cnt))
cnt = cnt + 1
Loop
Log("checksum done")
I'm finding in some cases that this portion of code can take up to 20 seconds to run with a packet size of 4000 bytes. Why so slow, and is there any way I can speed it up? thanks.