Re: [Cbor] Map keys?

Jim Schaad <> Mon, 29 April 2019 15:49 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 73B4D120086 for <>; Mon, 29 Apr 2019 08:49:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 9zah3uS2_0cy for <>; Mon, 29 Apr 2019 08:49:13 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id DC76E12004E for <>; Mon, 29 Apr 2019 08:49:12 -0700 (PDT)
Received: from Jude ( by ( with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 29 Apr 2019 08:49:05 -0700
From: Jim Schaad <>
To: 'Felipe Gasper' <>, <>
References: <>
In-Reply-To: <>
Date: Mon, 29 Apr 2019 08:49:04 -0700
Message-ID: <003b01d4fea3$14012250$3c0366f0$>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_003C_01D4FE68.67A41F10"
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQFGBkt4cHgMpYZBnw/w3mkQotkUJqdxOVYQ
X-Originating-IP: []
Archived-At: <>
Subject: Re: [Cbor] Map keys?
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: Mon, 29 Apr 2019 15:49:16 -0000

Please file an errata on this.  The text should be “In JSON,…  CWT uses strings,…”  The document is talking about what CWT uses for keys and not what CBOR is using for keys.





From: CBOR <>; On Behalf Of Felipe Gasper
Sent: Monday, April 29, 2019 6:39 AM
Subject: [Cbor] Map keys?




I’m looking at RFC 8392, which says:



In JSON, maps are called objects and only have one kind of map key: a string. CBOR uses strings, negative integers, and unsigned integers as map keys. The integers are used for compactness of encoding and easy comparison. The inclusion of strings allows for an additional range of short encoded values to be used.
While this doesn’t directly say per se that CBOR _only_ uses strings and integers as map keys, the implication seems strong. I don’t see any such limitation in the CBOR RFC.
Does CBOR intend, then, to restrict map keys to only major types 0, 1, and 3?
Thank you!