Accumulate CRC32 Value (polynomial 0x11EDC6F41) (SSE4.2).
341464
public final void crc32(Register dst, Register src)
  {
    assert(dst.isRegType(REG_GPD) || dst.isRegType(REG_GPQ));
    emitX86(INST_CRC32, dst, src);
  }
3674
public static int generateInt32(int crc, int value)
  {
    crc = next(crc, (value >> 24));
    crc = next(crc, (value >> 16));
    crc = next(crc, (value >> 8));
    crc = next(crc, (value >> 0));

    return crc;
  }
554842
public static long crc32(byte[] bytes, int offset, int size) {
        CRC32 crc = new CRC32();
        crc.update(bytes, offset, size);
        return crc.getValue();
    }
178374
def _crc32(self, ch, crc):
        """"""
        return ((crc >> 8) & 0xffffff) ^ self.crctable[(crc ^ ord(ch)) & 0xff]
791945
public static int crc16(ByteBuffer bytes) {

        int crc = 0x0000;

        while (bytes.hasRemaining()) {
            crc = doCrc(bytes.get(), crc);
        }

        return crc & 0xFFFF;
    }
159934
def _crc16(data, crc, table):
    
    bytes_to_int = lambda x: ord(x) if sys.version_info.major == 2 else x
    for byte in data:
        crc = ((crc << 8) & 0xff00) ^ table[((crc >> 8) & 0xff) ^ bytes_to_int(byte)]
    return crc & 0xffff
1042600
def crc16jit(buf, offset, crc, length):
  """"""
  for index in range(offset, offset + length):
    data = buf[index]
    lookup = crc16_tab[((nb.u2(crc) >> 8) & nb.u2(0xFF)) ^ (data & nb.u2(0xFF))]
    crc = ((nb.u2(crc) << nb.u2(8)) & nb.u2(0xFFFF)) ^ lookup
    crc = nb.u2(crc) & nb.u2(0xFFFF)
  return crc
1299126
def accumulate_str(self, buf):
        ''''''
        accum = self.crc
        import array
        bytes = array.array('B')
        bytes.fromstring(buf)
        self.accumulate(bytes)
300568
def secp256r1():
        
        GFp = FiniteField(int("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", 16))
        ec = EllipticCurve(GFp, 115792089210356248762697446949407573530086143415290314195533631308867097853948, 41058363725152142129326129780047268409114441015993725554835256314039467401291)
        # return ECDSA(GFp, ec.point(0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296,0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5),int("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", 16))
        return ECDSA(ec,
                     ec.point(0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296, 0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5),
                     GFp)
1064870
public final void fst(Mem dst)
  {
    assert(dst.size() == 4 || dst.size() == 8);
    emitX86(INST_FST, dst);
  }
874350
def crc16(data):
    
    m_crc = 0xffff
    for this in data:
        m_crc ^= ord(this)
        for _ in range(8):
            j = m_crc & 1
            m_crc >>= 1
            if j:
                m_crc ^= 0x8408
    return m_crc
1354135
protected final void slicingBy4 (final int data) {

        crc ^= Integer.reverseBytes(data);

        final int term1 = CRC_TABLE_56[crc & FOURTH_BYTE_MASK] ^ CRC_TABLE_48[(crc >>> ONE_BYTE_SHIFT) & FOURTH_BYTE_MASK];
        final int term2 = crc >>> TWO_BYTES_SHIFT;
        crc = term1 ^ CRC_TABLE_40[term2 & FOURTH_BYTE_MASK] ^ CRC_TABLE_32[(term2 >>> ONE_BYTE_SHIFT) & FOURTH_BYTE_MASK];
    }
390733
static int calculateChecksum(ByteBuf data, int offset, int length) {
        Crc32c crc32 = new Crc32c();
        try {
            crc32.update(data, offset, length);
            return maskChecksum((int) crc32.getValue());
        } finally {
            crc32.reset();
        }
    }
869548
def crc_ccitt(data):
    # type: (bytes) -> int
    '''
    
    '''
    crc = 0
    if not have_py_3:
        for x in data:
            crc = crc_ccitt_table[ord(x) ^ ((crc >> 8) & 0xFF)] ^ ((crc << 8) & 0xFF00)  # type: ignore
    else:
        mv = memoryview(data)
        for x in mv.tobytes():
            crc = crc_ccitt_table[x ^ ((crc >> 8) & 0xFF)] ^ ((crc << 8) & 0xFF00)

    return crc
561581
def sar(computation: BaseComputation) -> None:
    
    shift_length, value = computation.stack_pop(num_items=2, type_hint=constants.UINT256)
    value = unsigned_to_signed(value)

    if shift_length >= 256:
        result = 0 if value >= 0 else constants.UINT_255_NEGATIVE_ONE
    else:
        result = (value >> shift_length) & constants.UINT_256_MAX

    computation.stack_push(result)
707328
public static void encodeDesc(double value, byte[] dst, int dstOffset) {
        long bits = Double.doubleToLongBits(value);
        if (bits >= 0) {
            bits ^= 0x7fffffffffffffffL;
        }
        int w = (int)(bits >> 32);
        dst[dstOffset    ] = (byte)(w >> 24);
        dst[dstOffset + 1] = (byte)(w >> 16);
        dst[dstOffset + 2] = (byte)(w >> 8);
        dst[dstOffset + 3] = (byte)w;
        w = (int)bits;
        dst[dstOffset + 4] = (byte)(w >> 24);
        dst[dstOffset + 5] = (byte)(w >> 16);
        dst[dstOffset + 6] = (byte)(w >> 8);
        dst[dstOffset + 7] = (byte)w;
    }
843907
def _astore16(ins):
    ''' 
    '''
    output = _addr(ins.quad[1])
    op = ins.quad[2]

    indirect = op[0] == '*'
    if indirect:
        op = op[1:]

    immediate = op[0] == '#'
    if immediate:
        op = op[1:]

    if is_int(op):
        op = str(int(op) & 0xFFFF)  # Truncate to 16bit pointer

        if indirect:
            if immediate:
                output.append('ld de, (%s)' % op)
            else:
                output.append('ld de, (%s)' % op)
                output.append('call __LOAD_DE_DE')
                REQUIRES.add('lddede.asm')
        else:
            H = int(op) >> 8
            L = int(op) & 0xFF
            output.append('ld (hl), %i' % L)
            output.append('inc hl')
            output.append('ld (hl), %i' % H)
            return output

    elif op[0] == '_':
        if indirect:
            if immediate:
                output.append('ld de, (%s)' % op)  # redundant: *#_id == _id
            else:
                output.append('ld de, (%s)' % op)  # *_id
                output.append('call __LOAD_DE_DE')
                REQUIRES.add('lddede.asm')
        else:
            if immediate:
                output.append('ld de, %s' % op)
            else:
                output.append('ld de, (%s)' % op)
    else:
        output.append('pop de')

    output.append('ld (hl), e')
    output.append('inc hl')
    output.append('ld (hl), d')

    return output