Arduino xor Checksum

String xorChecksum(String s) {
  byte b = s.charAt(0);
  for (int i=1; i<s.length(); i++) {
    b = b ^ s.charAt(i);
  }
  String checksum = String(b, HEX);
  if (checksum.length() ==1) checksum = "0" + checksum; 
  return checksum;
}
Keerthan Chand