From 22de3d3cff18d88deeeb45034c362397fbe3a5df Mon Sep 17 00:00:00 2001 From: Lucas de Oliveira Date: Mon, 12 Aug 2019 16:56:53 -0300 Subject: [PATCH] Changing java CRC16 class modifiers to enable external access (#720) --- java/src/com/swiftnav/sbp/client/CRC16.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/src/com/swiftnav/sbp/client/CRC16.java b/java/src/com/swiftnav/sbp/client/CRC16.java index 1d9213fef4..71aeb9d71f 100644 --- a/java/src/com/swiftnav/sbp/client/CRC16.java +++ b/java/src/com/swiftnav/sbp/client/CRC16.java @@ -11,7 +11,7 @@ */ package com.swiftnav.sbp.client; -final class CRC16 { +public final class CRC16 { private final static int[] tab = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, @@ -46,14 +46,14 @@ final class CRC16 { 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0}; - static int crc16(byte[] data, int crc) { + public static int crc16(byte[] data, int crc) { for (byte b : data) { crc = ((crc << 8) & 0xFFFF) ^ tab[((crc >> 8) ^ b) & 0xFF]; } return crc; } - static int crc16(byte[] data) { + public static int crc16(byte[] data) { return crc16(data, 0); } }