Qtra
Qtra

Reputation: 21

CRC32 in Java ME

Anyway of creating a 'CRC32' checksum value in 'Java ME (Micro Edition)'?

The Micro Edition SDK I am using does not include CRC methods or 'Biginteger', and anything I migrate from C is running into problems with signed long.

Upvotes: 0

Views: 108

Answers (1)

Qtra
Qtra

Reputation: 21

Found source code for CRC32 in 'Java'

http://developer.classpath.org/doc/java/util/zip/CRC32-source.html

public void update (int bval)
{
    int c = ~crc;
    c = crc_table[(c ^ bval) & 0xff] ^ (c >>> 8);
    crc = ~c;
}

Upvotes: 1

Related Questions