com.voxbiblia.id3j
Class CRC32Compensator
java.lang.Object
com.voxbiblia.id3j.CRC32Compensator
public class CRC32Compensator
- extends Object
The CRC32Compensator provides functionality to generate compensating data
bytes that can be put into a byte stream to yield any CRC-32 checksum.
For more information please see http://resare.com/crc32
|
Method Summary |
static byte[] |
compensate(int sourceChecksum,
int targetChecksum)
Returns 4 bytes of data that compensates the CRC32 checksum of some data
to match targetChecksum. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CRC32Compensator
public CRC32Compensator()
compensate
public static byte[] compensate(int sourceChecksum,
int targetChecksum)
- Returns 4 bytes of data that compensates the CRC32 checksum of some data
to match targetChecksum. In other words if a byte string S has the CRC32
checksum sourceChecksum and it is concatenated with the bytes returned
by this method the resulting byte string will have a CRC32 checksum
equal to targetChecksum.
- Parameters:
sourceChecksum - the current checksumtargetChecksum - the desired checksum
- Returns:
- four bytes of data