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

Carsten Bormann <> Fri, 25 June 2021 16:06 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 0D5DD3A077C for <>; Fri, 25 Jun 2021 09:06:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_FAIL=0.001, SPF_HELO_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id UBUnkORk2moR for <>; Fri, 25 Jun 2021 09:06:53 -0700 (PDT)
Received: from ( [IPv6:2001:638:708:32::19]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id C43533A0776 for <>; Fri, 25 Jun 2021 09:06:53 -0700 (PDT)
Received: from [] ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id 4GBMMF59N3z2xHN; Fri, 25 Jun 2021 18:06:49 +0200 (CEST)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.\))
From: Carsten Bormann <>
In-Reply-To: <25746.1624636305@localhost>
Date: Fri, 25 Jun 2021 18:06:49 +0200
Cc: =?utf-8?Q?Christian_Ams=C3=BCss?= <>, Doug Ewell <>,
X-Mao-Original-Outgoing-Id: 646330009.334366-bdd34c5a10c2dd6cdaa69f7ed89fbcb9
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <9704.1624378576@localhost> <YNN05Efh4/> <000201d76914$53aa4890$fafed9b0$> <> <25746.1624636305@localhost>
To: Michael Richardson <>
X-Mailer: Apple Mail (2.3608.
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:06:58 -0000

On 2021-06-25, at 17:51, Michael Richardson <> wrote:
> Signed PGP part
> 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?

Base 32 is ld(32) = 5 bits per character.
Base 4[12345] is 16 bits per three characters, i.e. 5.33 bits per character.
(Base 45 wastes most of another half bit that it might have.)

> 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.
> I'm surprised that base45 includes space, + and / :-)

QR code has an alphabet.  That *happens* to have 45 characters, because it uses half an 11-bit code (2**5.5 = 45.25), i.e., 5.5 bits off the raw encoding.

Of course you want to be able to have spaces etc. in the human-readable messages that QR-Code might convey.  But using all these for a basenn encoding is not needed, just because you have them.

That 45 is not a meaningful basexx number, as shown above, as Math.log2(45) = 5.49; you can’t do a lot with that.  
(That 5.49 is Math.log2((2**5.5).floor) if you want to know why).
Including the weird characters (“ “ , ”%”, choose another two) in a basenn encoding is, er, not so bright, as the poor DGC people had to find out.

Grüße, Carsten