Check for the hex
429748
def _str_to_int(self, string):
        
        string = string.lower()
        if string.endswith("l"):
            string = string[:-1]
        if string.lower().startswith("0x"):
            # should always match
            match = re.match(r'0[xX]([a-fA-F0-9]+)', string)
            return int(match.group(1), 0x10)
        else:
            return int(string)
329804
def unhex(inp):
    ''''''
    res = inp.split(r'\x')
    for i in xrange(1, len(res)):
        item = res[i]
        try:
            res[i] = _hextochr[item[:2]] + item[2:]
        except KeyError:
            res[i] = '%' + item
        except UnicodeDecodeError:
            res[i] = unichr(int(item[:2], 16)) + item[2:]
    return ''.join(res)
1172086
function ( hex, parse ) {
            var hex = hex.replace( '#', '' ),
                result = {};
    
            if ( hex.length < 5 ) hex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2);
    
            ( '#' + hex ).replace( this.REG_HEX, function ( str, va, vb, vc ) {
                var r = Number( '0x' + va ).toString( 10 ),
                    g = Number( '0x' + vb ).toString( 10 ),
                    b = Number( '0x' + vc ).toString( 10 );
    
                result = {r: Number(r), g: Number(g), b: Number(b), a: 1};
            });
    
            return parse? result : 'rgb(' + result.r + ', ' + result.g + ', ' + result.b + ')';
        }
1159426
private static int decode(final int hex) {
        if (hex >= CcHex.BACK.length) {
            throw new DecodingException(
                String.format("invalid hex char: 0x%2x", hex)
            );
        }
        final int dec = CcHex.BACK[hex];
        if (dec < 0) {
            throw new DecodingException(
                String.format("invalid hex character: 0x%2x", hex)
            );
        }
        return dec;
    }
1019861
function hexToBytes(hex) {
	var bytes = [];
	for(var c = 0, C = hex.length; c < C; c += 2) {
		bytes.push(parseInt(hex.substr(c, 2), 16));
	}
	return bytes;
}
1221802
def hexdigest(self):
        """"""
        if not self._final:
            if self._buf_len >= self._MIN_LEN:
                self._tlsh.final()
                self._final = True
            else:
                raise ValueError("tlsh requires buffer with length >= %d "
                                 "for mode where force = %s" % \
                                 (self._MIN_LEN, False))
        return self._tlsh.hexdigest()
481982
private function hexToDec($hex)
	{
		$dec = 0;
		$bitval = 1;
		$len = strlen($hex);
		for ($pos = ($len - 1); $pos >= 0; --$pos) {
			$dec = bcadd($dec, bcmul(hexdec($hex[$pos]), $bitval));
			$bitval = bcmul($bitval, 16);
		}
		return $dec;
	}
233128
def hex(self):
        """"""

        sign = '-' if self._sign() else ''
        e = self._exponent()
        if isinstance(e, six.string_types):
            return sign + e

        m = self._significand()
        _, digits, _ = _mpfr_get_str2(
            16,
            0,
            m,
            ROUND_TIES_TO_EVEN,
        )
        # only print the number of digits that are actually necessary
        n = 1 + (self.precision - 1) // 4
        assert all(c == '0' for c in digits[n:])
        result = '%s0x0.%sp%+d' % (sign, digits[:n], e)
        return result
291438
def crc_ihex(hexstr):
    

    crc = sum(bytearray(binascii.unhexlify(hexstr)))
    crc &= 0xff
    crc = ((~crc + 1) & 0xff)

    return crc
1311265
private void setHex() {

        String hRed = Integer.toHexString(getRed());
        String hGreen = Integer.toHexString(getGreen());
        String hBlue = Integer.toHexString(getBlue());

        if (hRed.length() == 0) {
            hRed = "00";
        }
        if (hRed.length() == 1) {
            hRed = "0" + hRed;
        }
        if (hGreen.length() == 0) {
            hGreen = "00";
        }
        if (hGreen.length() == 1) {
            hGreen = "0" + hGreen;
        }
        if (hBlue.length() == 0) {
            hBlue = "00";
        }
        if (hBlue.length() == 1) {
            hBlue = "0" + hBlue;
        }

        m_hex = hRed + hGreen + hBlue;
    }
779537
function rgb2hex(rgb) {
      if (/^#[0-9A-F]{6}$/i.test(rgb)) {
        return rgb;
      }

      rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);

      if (rgb === null) {
        return 'N/A';
      }

      function hex(x) {
        return ('0' + parseInt(x).toString(16)).slice(-2);
      }

      return '#' + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
    }
688135
static String hex0(final byte x) {
        final char tab[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
                'a', 'b', 'c', 'd', 'e', 'f' };
        int uint;
        if (x < 0) {
            uint = x & 0x7F;
            uint |= 1 << 7;
        } else {
            uint = x;
        }
        return "" + tab[uint >>> 4] + tab[uint & 0xF];
    }
1054988
function getAlphaHex(alpha) {
    var num = Math.round(alpha * 255);
    var hex = num.toString(16);

    return hex.length === 1 ? '0' + hex : hex;
}
520017
public Token scanHexDecimal() {
        int length = HEX_BEGIN_SYMBOL_LENGTH;
        if ('-' == charAt(offset + length)) {
            length++;
        }
        while (isHex(charAt(offset + length))) {
            length++;
        }
        return new Token(Literals.HEX, input.substring(offset, offset + length), offset + length);
    }
475844
def _dehex(s):
    """"""
    import re
    import binascii

    # Remove all non-hexadecimal digits
    s = re.sub(br'[^a-fA-F\d]', b'', s)
    # binscii.unhexlify works in Python 2 and Python 3 (unlike
    # thing.decode('hex')).
    return binascii.unhexlify(s)
602803
function validHex(t) {
	for (var i = 0; i < t.length; i++) {
		var c = t.charAt(i);
		if (!((c >= 'a' && c <= 'f') || (c >= '0' && c <= '9'))) return false;
	}
	return true;
}
582457
private boolean checkEeTaxNumber(final String ptaxNumber) {
    final int checkSum = ptaxNumber.charAt(10) - '0';
    int calculatedCheckSum = ((ptaxNumber.charAt(0) - '0') * 1 //
        + (ptaxNumber.charAt(1) - '0') * 2 //
        + (ptaxNumber.charAt(2) - '0') * 3 //
        + (ptaxNumber.charAt(3) - '0') * 4 //
        + (ptaxNumber.charAt(4) - '0') * 5 //
        + (ptaxNumber.charAt(5) - '0') * 6 //
        + (ptaxNumber.charAt(6) - '0') * 7 //
        + (ptaxNumber.charAt(7) - '0') * 8 //
        + (ptaxNumber.charAt(8) - '0') * 9 //
        + (ptaxNumber.charAt(9) - '0') * 1) //
        % MODULO_11;
    if (calculatedCheckSum == 10) {
      calculatedCheckSum = ((ptaxNumber.charAt(0) - '0') * 3 //
          + (ptaxNumber.charAt(1) - '0') * 4 //
          + (ptaxNumber.charAt(2) - '0') * 5 //
          + (ptaxNumber.charAt(3) - '0') * 6 //
          + (ptaxNumber.charAt(4) - '0') * 7 //
          + (ptaxNumber.charAt(5) - '0') * 8 //
          + (ptaxNumber.charAt(6) - '0') * 9 //
          + (ptaxNumber.charAt(7) - '0') * 1 //
          + (ptaxNumber.charAt(8) - '0') * 2 //
          + (ptaxNumber.charAt(9) - '0') * 3) //
          % MODULO_11 % 10;
    }
    return checkSum == calculatedCheckSum;
  }