def bytes_to_int(bts: bytes, signed: bool=False) ->int:
    """Convert a string of bytes to an integer number.

    Whether the final int should be signed or not can't be determined, so it
    must be specified.

    Note: reversibility is not assured! I.E.: if the bytes string begins with
    null values, those will be lost and converting the resulting integer into
    bytes will yield a different value.
    """
    if not isinstance(bts, bytes):
        raise TypeError('bts must be bytes')
    return int.from_bytes(bts, 'big', signed=signed)
