import codecs


def bytes_to_int(value):
    """
    Convert byte string to integer.

    @type value: six.binary_type
    @rtype: Union[six.integer_types]
    """
    return int(codecs.encode(value, 'hex'), 16)