Serializes n as variable size integer to the provided buffer.
    Buffer has to ha
    :param n:
    :param buffer:
    :param offset:
    :return:

def dump_uvarint_b_into(n, buffer, offset=0):
    """
    Serializes n as variable size integer to the provided buffer.
    Buffer has to ha
    :param n:
    :param buffer:
    :param offset:
    :return:
    """
    shifted = True
    while shifted:
        shifted = n >> 7
        buffer[offset] = (n & 0x7F) | (0x80 if shifted else 0x00)
        offset += 1
        n = shifted
    return buffer