Java CRC Calculate crc321(byte[] buf, int off, int len)

Here you can find the source of crc321(byte[] buf, int off, int len)

Description

crc

License

Open Source License

Declaration

public static int crc321(byte[] buf, int off, int len) 

Method Source Code

//package com.java2s;

public class Main {
    public static int crc321(byte[] buf, int off, int len) {
        int crc = 0xffffffff;
        while (len-- != 0) {
            crc ^= buf[off++] & 0xFF;
            for (int i = 0; i < 8; i++) {
                if ((crc & 1) == 1) {
                    crc >>>= 1;
                    crc ^= 0xEDB88320;/*from   w  w  w . jav a 2s  .c o  m*/
                } else
                    crc >>>= 1;
            }
        }
        return crc;
    }
}

Related

  1. CRC32(final byte[] buf, final int startPos, final int endPos)
  2. crc32(int[] table, int crc, byte[] buffer, int off, int len)
  3. crc32(long crcin, byte[] buf, int off, int alen)
  4. crc32(String input)
  5. crc320(byte[] buf, int off, int len)
  6. crc32Hash(String key)
  7. crc64(String value)
  8. crc8(byte data, byte crcInit, byte poly)
  9. crc8(String value)