def varintdecode(data):  # pragma: no cover
    """ Varint decoding
    """
    shift = 0
    result = 0
    for b in bytes(data):
        result |= (b & 0x7F) << shift
        if not (b & 0x80):
            break
        shift += 7
    return result