Thursday, October 7, 2010

[Android Snippet] CRC32 in Android

Minimum API Level : 1

Key class: CRC32

CRC (Cyclic Redundancy Check) is one of checksum algorithms that designed for digital data verification purpose. This snippet is showing how to calculate CRC32 value from byte array data using CRC32 class



public long calculateCrc32(byte[] data){
CRC32 crc = new CRC32();
crc.update(data);
return crc.getValue();
}

No comments:

Post a Comment