public class Ut0Crc32 extends Object
CRC32 implementation from Facebook, based on the zlib implementation.
This file is translated based on ut/ut0crc32.cc in MySQL, and I
make it from C language to Java language and reserve the
original naming convention, so checkstyle should suppress the warnings.
Most of the code was taken from MySQL codebase. Here to acknowledge the copyright and author.
| 构造器和说明 |
|---|
Ut0Crc32() |
| 限定符和类型 | 方法和说明 |
|---|---|
static long |
crc32(byte[] data,
int offset,
int len) |
static long |
crc32ByteByByte(byte[] data,
int offset,
int len) |
static long |
fromByteArray(byte[] bytes,
int offset)
Returns the
long value whose little-endian representation is stored
in the 8 bytes of bytes from offset. |
static long |
utCrc3264LowSw(long crc,
long data,
long[][] table)
Calculate CRC32 over a 64-bit integer using a software implementation.
|
static long |
utCrc328Sw(long crc,
long data,
long[][] table) |
static long |
utCrc32SwapByteorder(long i) |
public static long crc32(byte[] data,
int offset,
int len)
public static long crc32ByteByByte(byte[] data,
int offset,
int len)
public static long utCrc3264LowSw(long crc,
long data,
long[][] table)
crc - crc32 checksum so fardata - data to be checksummedtable - base table to calculatepublic static long utCrc328Sw(long crc,
long data,
long[][] table)
public static long utCrc32SwapByteorder(long i)
public static long fromByteArray(byte[] bytes,
int offset)
long value whose little-endian representation is stored
in the 8 bytes of bytes from offset.Copyright © 2019–2020 Alibaba Group Holding Limited. All rights reserved.