import binascii


def btox(data, sep=''):
    """Return the hex encoding of a blob (byte string)."""
    # translate the blob into hex
    hex_str = str(binascii.hexlify(data), 'ascii')
    # inject the separator if it was given
    if sep:
        hex_str = sep.join(hex_str[i:i+2] for i in range(0, len(hex_str), 2))
    # return the result
    return hex_str