Here you can find the source of crc32Number(String s)
public static long crc32Number(String s)
//package com.java2s; //License from project: Apache License import java.util.zip.CRC32; import java.util.zip.Checksum; public class Main { public static long crc32Number(String s) { try {// www .ja v a 2 s . co m // Convert string to bytes byte bytes[] = s.getBytes(); Checksum checksum = new CRC32(); checksum.update(bytes, 0, bytes.length); /* * Get the generated checksum using getValue method of CRC32 class. */ long lngChecksum = checksum.getValue(); return lngChecksum; } catch (Exception e) { e.printStackTrace(); } return 0; } }