def unpack_vlq(data):
    """Return the first VLQ number and byte offset from a list of bytes."""
    offset = 0
    value = 0
    while True:
        tmp = data[offset]
        value = (value << 7) | (tmp & 0x7f)
        offset += 1
        if tmp & 0x80 == 0:
            break
    return value, offset