@Override public long getValue() { return impl.getValue(); }
@Override public void reset() { impl.reset(); tbytes = 0; }
@Override public void update(int val) { impl.update(new byte[] { (byte) val }, 0, 1); }
public CRC32 copy(){ CRC32 foo = new CRC32(); foo.v = this.v; return foo; }
gf2_matrix_square(even, odd); gf2_matrix_square(odd, even); gf2_matrix_square(even, odd); if ((len2 & 1)!=0) crc1 = gf2_matrix_times(even, crc1); len2 >>= 1; gf2_matrix_square(odd, even); if ((len2 & 1)!=0) crc1 = gf2_matrix_times(odd, crc1); len2 >>= 1;
public static long crc32_combine(long crc1, long crc2, long len2){ return CRC32.combine(crc1, crc2, len2); } }
static final void gf2_matrix_square(long[] square, long[] mat) { for (int n = 0; n < GF2_DIM; n++) square[n] = gf2_matrix_times(mat, mat[n]); }
@JRubyMethod(name = "crc_table", module = true, visibility = PRIVATE) public static IRubyObject crc_table(IRubyObject recv) { Ruby runtime = recv.getRuntime(); int[] table = com.jcraft.jzlib.CRC32.getCRC32Table(); RubyArray array = runtime.newArray(table.length); for (int i = 0; i < table.length; i++) { array.append(runtime.newFixnum(table[i] & 0xffffffffL)); } return array; }
public CRC32 copy(){ CRC32 foo = new CRC32(); foo.v = this.v; return foo; }
gf2_matrix_square(even, odd); gf2_matrix_square(odd, even); gf2_matrix_square(even, odd); if ((len2 & 1)!=0) crc1 = gf2_matrix_times(even, crc1); len2 >>= 1; gf2_matrix_square(odd, even); if ((len2 & 1)!=0) crc1 = gf2_matrix_times(odd, crc1); len2 >>= 1;
public static long crc32_combine(long crc1, long crc2, long len2){ return CRC32.combine(crc1, crc2, len2); } }
static final void gf2_matrix_square(long[] square, long[] mat) { for (int n = 0; n < GF2_DIM; n++) square[n] = gf2_matrix_times(mat, mat[n]); }
@JRubyMethod(name = "crc_table", module = true, visibility = PRIVATE) public static IRubyObject crc_table(IRubyObject recv) { Ruby runtime = recv.getRuntime(); int[] table = com.jcraft.jzlib.CRC32.getCRC32Table(); RubyArray array = runtime.newArray(table.length); for (int i = 0; i < table.length; i++) { array.append(runtime.newFixnum(table[i] & 0xffffffffL)); } return array; }
public CRC32 copy(){ CRC32 foo = new CRC32(); foo.v = this.v; return foo; }
@Override public void update(byte[] buf, int off, int nbytes) { // avoid int overflow, check null buf if (off <= buf.length && nbytes >= 0 && off >= 0 && buf.length - off >= nbytes) { impl.update(buf, off, nbytes); tbytes += nbytes; } else { throw new ArrayIndexOutOfBoundsException(); } } }
gf2_matrix_square(even, odd); gf2_matrix_square(odd, even); gf2_matrix_square(even, odd); if ((len2 & 1)!=0) crc1 = gf2_matrix_times(even, crc1); len2 >>= 1; gf2_matrix_square(odd, even); if ((len2 & 1)!=0) crc1 = gf2_matrix_times(odd, crc1); len2 >>= 1;
/** * Resets Rpc CRC-32 to initial value. */ public void reset() { this.jcrc32.reset(); }
/** * Returns CRC-32 value. */ public long getValue() { return this.jcrc32.getValue(); } }
public static long crc32_combine(long crc1, long crc2, long len2){ return CRC32.combine(crc1, crc2, len2); } }
static final void gf2_matrix_square(long[] square, long[] mat) { for (int n = 0; n < GF2_DIM; n++) square[n] = gf2_matrix_times(mat, mat[n]); }