Java examples for Security:CRC
Convert String to CRC32
import java.util.zip.CRC32; public class Main { public static void main(String[] args) { String src = "this is a test"; CRC32 crc = new CRC32(); crc.update(src.getBytes());//from w w w. j a va2 s.c om String hex = Long.toHexString(crc.getValue()); System.out.println("jdk crc32 : " + hex); } }