Re: [Cbor] Use and development of draft-faltstrom-base45 (was: Re: CBOR in QRcodes)

Christian Amsüss <> Fri, 25 June 2021 16:08 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id D6C293A07AB for <>; Fri, 25 Jun 2021 09:08:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 1fnmUJMpJlId for <>; Fri, 25 Jun 2021 09:08:37 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 140F33A07A2 for <>; Fri, 25 Jun 2021 09:08:37 -0700 (PDT)
Received: from (unknown [IPv6:2a02:b18:c13b:8010:a800:ff:fede:b1bd]) by (Postfix) with ESMTPS id 543644001D; Fri, 25 Jun 2021 18:08:34 +0200 (CEST)
Received: from ( []) by (Postfix) with ESMTP id 86E51D7; Fri, 25 Jun 2021 18:08:33 +0200 (CEST)
Received: from (unknown [IPv6:2a02:b18:c13b:8010:90c8:39c3:8a99:101f]) by (Postfix) with ESMTPSA id 472A87D; Fri, 25 Jun 2021 18:08:33 +0200 (CEST)
Received: (nullmailer pid 1401755 invoked by uid 1000); Fri, 25 Jun 2021 16:08:32 -0000
Date: Fri, 25 Jun 2021 18:08:32 +0200
From: Christian =?iso-8859-1?Q?Ams=FCss?= <>
To: Michael Richardson <>
Cc: Doug Ewell <>,
Message-ID: <YNX/>
References: <9704.1624378576@localhost> <YNN05Efh4/> <000201d76914$53aa4890$fafed9b0$> <> <25746.1624636305@localhost>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L9kdnzZwE0IfNThN"
Content-Disposition: inline
In-Reply-To: <25746.1624636305@localhost>
Archived-At: <>
Subject: Re: [Cbor] Use and development of draft-faltstrom-base45 (was: Re: CBOR in QRcodes)
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 25 Jun 2021 16:08:39 -0000

On Fri, Jun 25, 2021 at 11:51:45AM -0400, Michael Richardson wrote:
> I don't have enough caffeine in me to figure out how much more efficient
> base45 is over base32.  I think it's log(45)/log(32), right?

The efficiency of base45 on its own is pretty irrelevant, because it's
something that'd be only used inside an environment where these 45
characters are encoded in 5.5 bits of the QR code.

base45 does a 2-to-3 encoding, so one 8 bit of binary data gets spread
to 24/2=12 bit of ASCII base45 string, but those 1.5 characters are
encoded in 1.5*5.5 = 8.25 bit, so in the end it's a 3% loss.

(Same would be the case for 2-to-3 encodings possible with

> In places where base64 or base85 won't work, it seems to me that base32 is
> probably safer than base45.   As I wrote, I think that the limitation for
> QRcode entry has to do with forms on web pages or 3270 terminals, where the
> scanner is a bump-in-the-cord on the keyboard interface.  Whether it's a
> PS2/PS2 or a second USB input.

The RFC4648 base32 alphabet does work, but it's a 5-to-8 encoding, so
it'd give 1.6*6.6 bytes payload binary per byte QR-internal binary, so
it's 10% instead of 3% overhead.

Whether that really matters all that much is, as far as generic
recommendations for QR codes go, probably up for debate. (Even in the
health certificate use case there was discussion that if border
conditions were different, base32 would have been a good choice).

> I'm surprised that base45 includes space, + and / :-)

And the percent character; that's part of the trouble (but then again, 4
can be removed without loss of efficiency).


There's always a bigger fish.
  -- Qui-Gon Jinn