code: public static long file(File f) throws IOException {
          FileInputStream fi = new FileInputStream(f);
          byte[] buff = new byte[64 * 1024];
          int len;
          CRC32 crc32 = new CRC32();
          try {
              while ((len = fi.read(buff)) != -1) {
                  crc32.update(buff, 0, len);
              }
          } catch (Exception e) {
              e.printStackTrace();
          } finally {
              fi.close();
          }
  
          return crc32.getValue();
      }
docs: 对文件内容计算crc32校验码
  
  @param f 需要计算crc32校验码的文件
  @return crc校验码
  @throws IOException 读取文件异常