[Cbor] Off topic: tlv.dumps() and tlv.loads()

Brian E Carpenter <brian.e.carpenter@gmail.com> Sun, 19 May 2019 22:51 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C794612008D for <cbor@ietfa.amsl.com>; Sun, 19 May 2019 15:51:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J0tNdh0LyaRY for <cbor@ietfa.amsl.com>; Sun, 19 May 2019 15:51:52 -0700 (PDT)
Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2FE0412003E for <cbor@ietf.org>; Sun, 19 May 2019 15:51:52 -0700 (PDT)
Received: by mail-pf1-x429.google.com with SMTP id g9so6232999pfo.11 for <cbor@ietf.org>; Sun, 19 May 2019 15:51:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:reply-to:from:subject:organization:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=2B1xaU+rQ4L7ZugQ8DwyVDdnC8EJzuXgRO8JDSCor3g=; b=SRFB+1YwwH+l6qFlj6WrrGvIiSlpldWqy6Z6s6JQ4CCrpa2YU0qK7AqlRwf8S2RGer lE5gZlxQtwEmOHdtja+ba/GM4gc0mJugv4CLSxui/I6I5RLeHzhI2YONe5tTvg4VevUo oOLOM1z4LsD/hiw9i3ett+FdMruONuMixpZPSTMjhJqylAmPb1yi+NYgx7AqqlPaiDCk MDWljNznbqVA0PYy1x7ms/ljkK/YFV6HAqTJjblKLcR7MB8DI4qjBFnZvsAnMAIJemgo pF3bnCkJ7UmwJaAVxA/XFkw1yIYzSHhoolFQRNKI3FV91VpB3O7mg7nZiQAkJmSUzUwL 14Fw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:reply-to:from:subject:organization:message-id :date:user-agent:mime-version:content-language :content-transfer-encoding; bh=2B1xaU+rQ4L7ZugQ8DwyVDdnC8EJzuXgRO8JDSCor3g=; b=rEWWkLnhat8g137UpPbu21rYfeaPVeOKflV2Vj6lwipnYA3HIhdaJWq65XH4vJLuUe EPGu85PvsQfoxDtuBI7mGhUbEKBy1xFch48627Bz0JSGS/VRS5aNRBWlpRrz3mB2vO0y KUQDTyH1GXp13XbpHh9UOfyCxNlznWEtL1t6jnCewEF39ui3FCx3Q1xtTAiQXgNFRo98 GIpVMIfKa/o0FHUPxhKvL6e2nAln35SBPCqza0eqQxdmTwWiGdt3+P3KAjbraPzQ0VLy 0YKeZq22YqABZj550+QPsD/KzIoAo0A3BT0J7lk3OhdrUg6hvpnnysGZAL8+i/uRCBub qYYg==
X-Gm-Message-State: APjAAAXXuIGgXg2vNqh55kGjlM8ReIDnZMvPN71b1EoNW8CBOHH0256h S8KAZoEHm15vhBVkiOtxWsfKZK3H
X-Google-Smtp-Source: APXvYqyOJJA0UOcxTQk/BaMSW0HXjJN44JWlX0cRgvbQRQOyv9FLXPz/VuQ3YNPdnmydKBaPvYgf2g==
X-Received: by 2002:a63:1706:: with SMTP id x6mr71505857pgl.280.1558306311376; Sun, 19 May 2019 15:51:51 -0700 (PDT)
Received: from [192.168.178.30] (229.129.69.111.dynamic.snap.net.nz. [111.69.129.229]) by smtp.gmail.com with ESMTPSA id u6sm24352791pfa.1.2019.05.19.15.51.49 for <cbor@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 15:51:50 -0700 (PDT)
To: cbor@ietf.org
Reply-To: Brian E Carpenter <brian.e.carpenter@gmail.com>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Organization: University of Auckland
Message-ID: <35791dd6-9492-0334-c8ac-76057eb7ae93@gmail.com>
Date: Mon, 20 May 2019 10:51:48 +1200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/8M_V-7VzmajbdH3iK29fVk7XxCs>
Subject: [Cbor] Off topic: tlv.dumps() and tlv.loads()
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 19 May 2019 22:51:54 -0000

Hi,

This is off-topic so please reply privately if at all. I thought it might interest some people here.

For a recent small project, I wanted to directly compare CBOR and traditional TLV versions of the same protocol. To simplify this, I wrote a small Python3 module that provides tlv.dumps() and tlv.loads(). They handle pattern-driven encoding and decoding of Python objects as a TLV byte string.

If interested, see https://github.com/becarpenter/tlv (code plus issue tracker), and contact me by email.
 
Regards
   Brian Carpenter