Java CRC Calculate crc8PushByte(int[] crc, byte add)

Here you can find the source of crc8PushByte(int[] crc, byte add)

Description

crc Push Byte

License

Open Source License

Declaration

private static void crc8PushByte(int[] crc, byte add) 

Method Source Code

//package com.java2s;

public class Main {
    private static void crc8PushByte(int[] crc, byte add) {
        int addInt = (add & 0x000000FF);
        crc[0] = crc[0] ^ addInt;/*  www  .ja va2 s.c o m*/
        for (int i = 0; i < 8; i++) {
            if ((crc[0] & 0x00000001) != 0x00000000) {
                crc[0] = (crc[0] >> 1) ^ 0x0000008C;
            } else {
                crc[0] = (crc[0] >> 1);
            }
        }
    }
}

Related

  1. crc32Hash(String key)
  2. crc64(String value)
  3. crc8(byte data, byte crcInit, byte poly)
  4. crc8(String value)
  5. crc8_tab(byte data, byte crcInit)
  6. crcUpdate(int old, int value)