Here you can find the source of getCrc32(byte[] buf)
Parameter | Description |
---|---|
buf | The bytes to calculate the checksum of. |
public static long getCrc32(byte[] buf)
//package com.java2s; /*//from www.jav a2s . c o m * Copyright (C) 2015 University of Oregon * * You may distribute under the terms of either the GNU General Public * License or the Apache License, as specified in the LICENSE file. * * For more information, see the LICENSE file. */ import java.util.zip.CRC32; public class Main { /** * Get the standard CRC32 checksum of a byte array. * @param buf The bytes to calculate the checksum of. * @return The checksum. */ public static long getCrc32(byte[] buf) { CRC32 crc = new CRC32(); crc.update(buf); return crc.getValue(); } }