diff options
author | Ivan Muratov <binakot@gmail.com> | 2017-07-13 08:45:18 +0300 |
---|---|---|
committer | Ivan Muratov <binakot@gmail.com> | 2017-07-13 08:45:18 +0300 |
commit | 93227f9bffdfce2f1d60a61ea88f4eb152dfada5 (patch) | |
tree | c55745c3ebf2c09acd2d784f828c79e2f3e588c6 /src/org/traccar/helper/Checksum.java | |
parent | 85f7eae47ec4bf6b269305a05a696f9acce31fd5 (diff) | |
parent | 358b591bc457786927ac1466e10181bbffbcf56b (diff) | |
download | trackermap-server-93227f9bffdfce2f1d60a61ea88f4eb152dfada5.tar.gz trackermap-server-93227f9bffdfce2f1d60a61ea88f4eb152dfada5.tar.bz2 trackermap-server-93227f9bffdfce2f1d60a61ea88f4eb152dfada5.zip |
Merge branch 'arnavi4_impl'
Diffstat (limited to 'src/org/traccar/helper/Checksum.java')
-rw-r--r-- | src/org/traccar/helper/Checksum.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/helper/Checksum.java b/src/org/traccar/helper/Checksum.java index 43ba6a689..7a0151d36 100644 --- a/src/org/traccar/helper/Checksum.java +++ b/src/org/traccar/helper/Checksum.java @@ -243,4 +243,12 @@ public final class Checksum { return (10 - (checksum % 10)) % 10; } + public static int modulo256(byte... bytes) { + int sum = 0; + for (byte b : bytes) { + sum = (sum + b) & 0xFF; + } + return sum; + } + } |