All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ro.kuberam.libs.java.ftclient.utils.CalculateChecksum Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package ro.kuberam.libs.java.ftclient.utils;

import java.io.IOException;
import java.util.zip.CRC32;

public class CalculateChecksum {
	
	public static String crc32(byte[] resourceBytes) throws IOException, Exception {

		long checksum = 0;		
		if (resourceBytes != null) {
			CRC32 crc32 = new CRC32();
			crc32.update(resourceBytes, 0, resourceBytes.length);
			checksum = crc32.getValue();			
		}
		
		return Long.toHexString(checksum);
	}	

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy