Re: [Cbor] Cutting down base64 (b64'....') in diagnostic notation examples, before elision

Michael Richardson <mcr@sandelman.ca> Thu, 24 March 2022 18:17 UTC

Return-Path: <mcr@sandelman.ca>
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 09CFA3A0A01 for <cbor@ietfa.amsl.com>; Thu, 24 Mar 2022 11:17:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 r8rlwq8fJeZw for <cbor@ietfa.amsl.com>; Thu, 24 Mar 2022 11:17:18 -0700 (PDT)
Received: from relay.sandelman.ca (relay.cooperix.net [176.58.120.209]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 48E583A005C for <cbor@ietf.org>; Thu, 24 Mar 2022 11:17:17 -0700 (PDT)
Received: from dooku.sandelman.ca (unknown [IPv6:2a02:3038:407:528c:125:89b1:c535:ce3c]) by relay.sandelman.ca (Postfix) with ESMTPS id 0CB8C1F458; Thu, 24 Mar 2022 18:17:14 +0000 (UTC)
Received: by dooku.sandelman.ca (Postfix, from userid 179) id 135C91A01AA; Thu, 24 Mar 2022 19:17:00 +0100 (CET)
From: Michael Richardson <mcr@sandelman.ca>
To: Carsten Bormann <cabo@tzi.org>, cbor@ietf.org
In-reply-to: <0B4A3773-CC4D-4404-9CF4-E58F34AF3574@tzi.org>
References: <0B4A3773-CC4D-4404-9CF4-E58F34AF3574@tzi.org>
Comments: In-reply-to Carsten Bormann <cabo@tzi.org> message dated "Wed, 23 Mar 2022 07:47:37 +0100."
X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.3
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature"
Date: Thu, 24 Mar 2022 19:17:00 +0100
Message-ID: <31286.1648145820@dooku>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/fDYNZg1343Q1sfw6iKxOU-BKVuo>
Subject: Re: [Cbor] Cutting down base64 (b64'....') in diagnostic notation examples, before elision
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: Thu, 24 Mar 2022 18:17:24 -0000

Carsten Bormann <cabo@tzi.org> wrote:
    > (1) Random observation, most relevant until we have elision:

    > If you randomly truncate a base64 string (no padding), there is only a
    > 1 out of 3 chance (actually 21/64) that the result will still be a
    > base64 string (no padding).  If you cut it down to a multiple of 4
    > characters, the result will always be valid.

That's a good point.
I wonder if this is worth sharing with the RPC people in some fashion.

    > (2) The current implementation of cbor-diag does not allow comments in
    > b64’…' (https://github.com/cabo/cbor-diag/issues/22).  However, they
    > already work in h’…’ byte strings, so…

    > h’47110815/.../‘

    > …or more verbosely…

    > h’47110815/... (rest of CWT omitted)/‘

Very Very Cool.

    > Because of the abovementioned bug, I’d use

    > b64’A7ii08iS'/... (rest of CWT omitted)/

    > …for now if b64 is needed (but see note about truncation above).

This email needs to go into some reference for people.

Maybe two slides posted to CBOR WG meeting tracker, URL sent around to
wgchairs.

"Is you internet-draft suffering from CBOR diagnostic notation bloat?"
"Is xml2rfc complaining about too long lines, and you just aren't sure how to
fix that?"
"Available now, for an unlimited time, the CBOR how-to-elide HOWTO"

--
]               Never tell me the odds!                 | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works        | network architect  [
]     mcr@sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [