import codecs


def binary_to_long(b):
    """Helper method to interpret binary data as an integer.

    >>> binary_to_long(b'\\x00')
    0
    >>> binary_to_long(b'\\xff')
    255
    >>> binary_to_long(b'\\x02\\x03')
    515
    """

    return int(codecs.encode(b, 'hex'), 16)