Can I this function better?
//Calculate Csum A = A XOR B
byte CountCsum(String m) {
byte[] inData = m.getBytes();
byte csum=0;
// Don't Count the first byte
for(byte n=1;n<m.length();n++)
csum ^= inData[n];
return csum;
}
In C you normally sending a pointer to an array into the function but here I must convert the string to byte array
an that takes time and memory.
Are java sending a reference to the string or the entire string to the function??