Create string representation of a PyXB Checksum object.

    Args:
      PyXB Checksum object

    Returns:
      str : Combined hexadecimal value and algorithm name.
502631
def format_checksum(checksum_pyxb):
    
    return '{}/{}'.format(
        checksum_pyxb.algorithm.upper().replace('-', ''), checksum_pyxb.value().lower()
    )
26765
def _get_checksum():
    
    digest = hashlib.sha256()
    with open(RPM_PATH, "rb") as rpm_db_fh:
        while True:
            buff = rpm_db_fh.read(0x1000)
            if not buff:
                break
            digest.update(buff)
    return digest.hexdigest()
478348
public static String binToHexString(byte[] bytes, int offset, int len) {
        return new String(binToHex(bytes, offset, len));
    }
710403
public static String byteArrayToHexString(byte[] bytes) {
    char[] hexChars = new char[bytes.length * 2];
    for (int j = 0; j < bytes.length; j++) {
      int v = bytes[j] & 0xFF;
      hexChars[j * 2] = HEX_SYMBOLS[v >>> 4];
      hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F];
    }
    return new String(hexChars);
  }
1056539
public static String toHexString( byte[] b ) {
        if ( null == b )
            return null;
        int len = b.length;
        byte[] hex = new byte[ len << 1 ];
        for ( int i = 0, j = 0; i < len; i++, j+=2 ) {
            hex[ j ] = (byte) ((b[ i ] & 0xF0) >> 4);
            hex[ j ] += 10 > hex[ j ] ? 48 : 87;
            hex[ j + 1 ] = (byte) (b[ i ] & 0x0F);
            hex[ j + 1 ] += 10 > hex[ j + 1 ] ? 48 : 87;
        }
        return new String( hex );
    }
117501
def _create_hexdump(src, start_offset=0, length=16):
        
        FILTER = "".join((len(repr(chr(x))) == 3) and chr(x) or "." for x in range(256))
        pattern = "{{0:04X}}   {{1:<{0}}}  {{2}}\n".format(length * 3)

        # Convert raw data to str (Python 3 compatibility)
        src = to_str(src, "latin-1")

        result = []
        for i in range(0, len(src), length):
            s = src[i : i + length]
            hexa = " ".join("{0:02X}".format(ord(x)) for x in s)
            printable = s.translate(FILTER)
            result.append(pattern.format(i + start_offset, hexa, printable))

        return "".join(result)
1304494
static String toHexString(final byte[] b) {
		StringBuffer sb = new StringBuffer("{");
		for (int i = 0; i < b.length; i++) {
			sb.append(toHexString(b[i]));
			if (i < b.length - 1) {
				sb.append(",");
			}
		}
		sb.append("}");
		return sb.toString();
	}
284118
def new_from_rgb_hex(cls, hex_str):
        
        colorstring = hex_str.strip()
        if colorstring[0] == '#':
            colorstring = colorstring[1:]
        if len(colorstring) != 6:
            raise ValueError("input #%s is not in #RRGGBB format" % colorstring)
        r, g, b = colorstring[:2], colorstring[2:4], colorstring[4:]
        r, g, b = [int(n, 16) / 255.0 for n in (r, g, b)]
        return cls(r, g, b)
910622
private static String byteArrayToHexString(byte[] b)
	{
		StringBuilder sb = new StringBuilder(b.length * 2);
		for (int i = 0; i < b.length; i++)
		{
			int v = b[i] & 0xff;
			if (v < 16)
			{
				sb.append('0');
			}
			sb.append(Integer.toHexString(v));
		}
		return sb.toString().toUpperCase();
	}
291438
def crc_ihex(hexstr):
    

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

    return crc
766471
def b58decode_check(v: str) -> bytes:
    ''''''

    result = b58decode(v)
    result, check = result[:-4], result[-4:]
    digest = sha256(sha256(result).digest()).digest()

    if check != digest[:4]:
        raise ValueError("Invalid checksum")

    return result
754472
def checksum(string):
    
    digits = list(map(int, string))
    odd_sum = sum(digits[-1::-2])
    even_sum = sum([sum(divmod(2 * d, 10)) for d in digits[-2::-2]])
    return (odd_sum + even_sum) % 10
862769
def file_checksum(filepath):
    
    checksum = hashlib.md5()
    with open(filepath, 'rb') as f:
        for fragment in iter(lambda: f.read(65536), ''):
            checksum.update(fragment)
    return checksum.hexdigest()
1080115
def format_hex(i, num_bytes=4, prefix='0x'):
    
    prefix = str(prefix or '')
    i = int(i or 0)
    return prefix + '{0:0{1}x}'.format(i, num_bytes)
471797
def checksum(self):
        
        total = 0

        # Add together all bytes
        for byte in self.data:
            total += byteToInt(byte)

        # Only keep the last byte
        total = total & 0xFF

        return intToByte(0xFF - total)
627653
public static String toHex(byte []bytes, int offset, int len)
  {
    if (bytes == null)
      return "null";
    
    StringBuilder sb = new StringBuilder();

    for (int i = 0; i < len; i++) {
      int d1 = (bytes[offset + i] >> 4) & 0xf;
      int d2 = (bytes[offset + i]) & 0xf;

      if (d1 < 10)
        sb.append((char) ('0' + d1));
      else
        sb.append((char) ('a' + d1 - 10));

      if (d2 < 10)
        sb.append((char) ('0' + d2));
      else
        sb.append((char) ('a' + d2 - 10));
    }

    return sb.toString();
  }
532902
public static String toHex(byte b) {
    final char[] string = { hexDigits[(b >> 4) & 0x0f], hexDigits[b & 0x0f] };
    return new String(string);
  }