aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper/Checksum.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-10-02 20:48:20 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-10-02 20:48:20 +1300
commitc74cded271c4e16c6fe122692de6b253b244d211 (patch)
tree6393ec7df30ed8723c4c12345d4bf426a23f7564 /src/org/traccar/helper/Checksum.java
parent8862d4f45712f6bee956c27380800d89105034e8 (diff)
downloadtrackermap-server-c74cded271c4e16c6fe122692de6b253b244d211.tar.gz
trackermap-server-c74cded271c4e16c6fe122692de6b253b244d211.tar.bz2
trackermap-server-c74cded271c4e16c6fe122692de6b253b244d211.zip
Fix some issues in JT600 decoder
Diffstat (limited to 'src/org/traccar/helper/Checksum.java')
-rw-r--r--src/org/traccar/helper/Checksum.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/org/traccar/helper/Checksum.java b/src/org/traccar/helper/Checksum.java
index dde174545..815962be0 100644
--- a/src/org/traccar/helper/Checksum.java
+++ b/src/org/traccar/helper/Checksum.java
@@ -195,12 +195,11 @@ public final class Checksum {
}
public static int xor(String string) {
- byte[] bytes = string.getBytes(StandardCharsets.US_ASCII);
- byte sum = 0;
- for (byte b : bytes) {
- sum ^= b;
+ byte checksum = 0;
+ for (byte b : string.getBytes(StandardCharsets.US_ASCII)) {
+ checksum ^= b;
}
- return sum;
+ return checksum;
}
public static String nmea(String msg) {