Re: [Cbor] Self Described CBOR - Little Endian

Joe Hildebrand <> Wed, 24 March 2021 20:06 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 7FAB93A34E9 for <>; Wed, 24 Mar 2021 13:06:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.697
X-Spam-Status: No, score=-1.697 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: (amavisd-new); dkim=neutral reason="invalid (public key: not available)"
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id P7dMXfPcrh5R for <>; Wed, 24 Mar 2021 13:06:40 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id C8AFE3A34F7 for <>; Wed, 24 Mar 2021 13:06:40 -0700 (PDT)
Received: by with SMTP id j11so118418ilu.13 for <>; Wed, 24 Mar 2021 13:06:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5ayziJhj6jrb9RvgzyvvGnKXiq4nO/ibhblmSrFjMZE=; b=EWQ7VT345Grx/2fjSipaI4xuNh96CtmN4li11wRoKNvs1e8h6Gh18glbppUYHn/RQC +945vmue0rRTHgQ3KqiWN2wHdnM/iIwGMoy68f06XDxJC5dC9rcKYOuuir8NW+n16G10 A1xX+2OKVuetfksYbNUEKYKQGRvvHhJjCtdPc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5ayziJhj6jrb9RvgzyvvGnKXiq4nO/ibhblmSrFjMZE=; b=P+L4o/ypdji1C1ZLtaRGCVNT3M1yNA+O0yKwMahyVhPLD55T3hrw4+K0oHYYVOCPUZ QxTvhdWf8ot0gFffwW0GpC+m9+q4Gt2pdEIn+Cew/hwwdaBbCaswVgzmfYfPn4gL0jdH pGGZLL1KaL3+8eYat9ma46wrf/csn7O5wW1JcWfZsqWpTsGM/BfqX2+NUARWSusStCv+ v791R18I+yG+RJW/hzjA008mcT5D51qE1grHWvTKi/+a5I/5v3dLVq/AkT4MGzjH7KwT k3piHKfZQWFjplWwDTb7rFwV+HRdyciP0DDuSu7w/3E/wF1x5/ZS7o8QofKsNEF/jRCZ l45A==
X-Gm-Message-State: AOAM5300/BMN3zTOJqMEdJRYcenX5nFdbjL3ojVee4H0v4CGFBD3L5Pc zhWN2HRqMgl5jK4TO+8zEOsNvg==
X-Google-Smtp-Source: ABdhPJxTRyNttsb0IrYciyulDG4nL1ZqInsyxrfFd50z/4IHr5L3vH+ogSAVwI+IM9xbWm4PoPjYqQ==
X-Received: by 2002:a92:ddd0:: with SMTP id d16mr4081101ilr.52.1616616399841; Wed, 24 Mar 2021 13:06:39 -0700 (PDT)
Received: from ?IPv6:2601:282:200:11c0:b1f4:81d1:7d97:eaa9? ([2601:282:200:11c0:b1f4:81d1:7d97:eaa9]) by with ESMTPSA id d22sm1485191iof.48.2021. (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Mar 2021 13:06:39 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.\))
From: Joe Hildebrand <>
In-Reply-To: <>
Date: Wed, 24 Mar 2021 14:06:38 -0600
Cc: "" <>
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <>
To: alex thompson <>
X-Mailer: Apple Mail (2.3654.
Archived-At: <>
Subject: Re: [Cbor] Self Described CBOR - Little Endian
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: Wed, 24 Mar 2021 20:06:46 -0000

Coincidentally, I just got a very small generic WASM decoder working:

Inspired by, but works synchronously in streaming mode, like expat.

Joe Hildebrand

> On Mar 22, 2021, at 10:50 PM, alex thompson <> wrote:
> ​Given the prevalence of little endian hardware and the existence of the LE typed array tags it would be useful to opt-in to LE encoding of the additional information bytes as well. This would simplify decoders that are specific to LE platforms, particularly WebAssembly which is all LE and hasn’t defined a swap instruction.
> The opt-in could be self described with tag 55798 (has the same non-unicode magic number characteristic as 55799). The beginning of a stream would default to BE so tag 55798 itself would appear as 0xd9d9f6. Then any following tags and descendant items would be LE.
> For completeness, 55798 and 55799 could be nested within one another, switching the endianness as the decoder traverses a tree of items. Nested tags 24 and 63 would pass on their endianness to their embedded items. No effect on typed array tags 64-87.
> It would be a breaking change for generic decoders since ignoring 55798 wouldn’t work as expected but I think the impact is very manageable and fits with CBOR’s stated goals of small code size and extensibility.
> Alex
> _______________________________________________
> CBOR mailing list