[Cbor] Re: Dealing with -0.0, NaN, and Infinity
Anders Rundgren <anders.rundgren.net@gmail.com> Thu, 22 August 2024 07:49 UTC
Return-Path: <anders.rundgren.net@gmail.com>
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 2DB69C1840C3 for <cbor@ietfa.amsl.com>; Thu, 22 Aug 2024 00:49:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z8oMYPpCcN6y for <cbor@ietfa.amsl.com>; Thu, 22 Aug 2024 00:49:18 -0700 (PDT)
Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 88989C180B5B for <cbor@ietf.org>; Thu, 22 Aug 2024 00:49:18 -0700 (PDT)
Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4281faefea9so2825515e9.2 for <cbor@ietf.org>; Thu, 22 Aug 2024 00:49:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724312957; x=1724917757; darn=ietf.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zVZfdElUV5/u/cj/D/uQ7tmGhnNf6iySyQsqC67yaX8=; b=IK6I/XbsFbLUBhp+dHsS0FSHWOc1gA8NyhK4Tfw/x1oYDjwASHoKFtFIrgoGYDKtVu a1sn8UHrx0R+Qa+2DGNEYgyJu8psHFIoXczTdXfMSrAaZzjdp71jo64PhdMgafRTn5dp Q4NK9ZuCGQqNzXdwG2I5Pcls1iLvfVSZlrzx9RcJhmOSJJjdUF5BdI+O0IAgko8iHVJt fut5El3jBwI7S1Dgsj9OUabEHqljQnUFd+vwbN0vLngLit3qBbTFEMje+y91REFZyDvD pasySNo7GCKUeW7jYxFFLjSDTKOSGer1u+mbPiriuWktzMNKed4YiQxsNyorN1lr4xcW 4TdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724312957; x=1724917757; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zVZfdElUV5/u/cj/D/uQ7tmGhnNf6iySyQsqC67yaX8=; b=DS0QySoTLMsJPefiTVoXcY92MZ4q3IOG8V4UAsV2NDxt0veIjhqLmFV+jXSFdKVbPP eJace15j+n1Gd/T/4WlbwhH+mxvmhwwKp73WZpG2ViaeGkgpvEKV6Ely1qf/c1cQOF7s VvLlYEXazMc3o61bQIFw+xFi02Mbxo8AmKppxJiIfyEBaRynKVdaAGhu6BhvfH5ixGhY U5n/rxmdniLSB2KSW1j6Z8MfgLwcwT4CPvnLxa4hHnzVMKRbNFAyX7RnGPNcj1M8G1aq y4c3VwCJNE5iekQs81qCyIU0+xczHXulnq9hbI+ZllF6Sg9piXtMXkGo3cltS8UsKVXy UuqQ==
X-Gm-Message-State: AOJu0YzcmPVLxW2jRIgnEKASjgiaHLEyfTA4yfPEBC19xu9TDHeJARkK e+hvaowAQw4/yaJED2xCgrcvOT5wL0V+h2qofmFIlBMp/QCnOZdhEWuGRA==
X-Google-Smtp-Source: AGHT+IG6d+Jv9t8jUXHoPEGae2sec2JeNCKgynEhCzZDSpA7p6Ja75o9xkv2653hIDMzFp3uSoknog==
X-Received: by 2002:a05:600c:3543:b0:428:fb96:e94a with SMTP id 5b1f17b1804b1-42abd11cf5amr36388695e9.9.1724312956585; Thu, 22 Aug 2024 00:49:16 -0700 (PDT)
Received: from ?IPV6:2a01:e0a:e1b:64b0:50:65b2:3d71:2b8e? ([2a01:e0a:e1b:64b0:50:65b2:3d71:2b8e]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-42abefd9cd1sm52002335e9.38.2024.08.22.00.49.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2024 00:49:16 -0700 (PDT)
Message-ID: <3432c848-354c-4bd0-b699-2669b8cbb922@gmail.com>
Date: Thu, 22 Aug 2024 09:49:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Carsten Bormann <cabo@tzi.org>
References: <17c394aa-095b-4a6d-95ee-0741b6b166f8@gmail.com> <2869DB6E-61BD-42D8-80B4-AA909C978B56@tzi.org> <fcdf23a9-fb0f-48d2-b141-dce1d634b6d9@gmail.com> <193D8044-AFBD-4C67-914C-7C17918C077D@tzi.org>
Content-Language: en-US
From: Anders Rundgren <anders.rundgren.net@gmail.com>
In-Reply-To: <193D8044-AFBD-4C67-914C-7C17918C077D@tzi.org>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Message-ID-Hash: IQ74M43J5DFVFZPPM3UZPQ3WBLLSAKNJ
X-Message-ID-Hash: IQ74M43J5DFVFZPPM3UZPQ3WBLLSAKNJ
X-MailFrom: anders.rundgren.net@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cbor.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: "cbor@ietf.org" <cbor@ietf.org>
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [Cbor] Re: Dealing with -0.0, NaN, and Infinity
List-Id: "Concise Binary Object Representation (CBOR)" <cbor.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/ou1cMHMoaqpj5CMPY2tNraaPKic>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Owner: <mailto:cbor-owner@ietf.org>
List-Post: <mailto:cbor@ietf.org>
List-Subscribe: <mailto:cbor-join@ietf.org>
List-Unsubscribe: <mailto:cbor-leave@ietf.org>
On 2024-08-21 14:43, Carsten Bormann wrote: > On 2024-08-21, at 12:44, Anders Rundgren <anders.rundgren.net@gmail.com> wrote: <snip> > BTW, I don’t think adding a ton of booleans to a constructor is a great way to handle different application Good catch! I had missed that the "builder" pattern (which I often advocate for), would be a perfect fit. Updated the API on they fly. Phew! Here is a snipped from https://cyberphone.github.io/CBOR.js/doc/playground.html which uses the entire set of decoder options: let decoder = CBOR.initDecoder(cborBytes) .setSequenceMode(sequenceFlag) .setDeterministicMode(deterministicFlag) .setNaNSupport(!rejectNaNFlag); while (object = decoder.decodeWithOptions()) { cborObjects.push(object); if (!sequenceFlag) { break; } } > requirements here (and describing the normal, non-CDE case by the “marketing” word “lenient” also doesn’t help). Although people tend to never agree on names, this may be a little bit closer to your heart: https://cyberphone.github.io/CBOR.js/doc/#decoder.cbor.initdecoder Anders > > Grüße, Carsten >
- [Cbor] Dealing with -0.0, NaN, and Infinity Anders Rundgren
- [Cbor] Re: Dealing with -0.0, NaN, and Infinity Carsten Bormann
- [Cbor] Re: Dealing with -0.0, NaN, and Infinity Anders Rundgren
- [Cbor] Re: Dealing with -0.0, NaN, and Infinity Carsten Bormann
- [Cbor] Re: Dealing with -0.0, NaN, and Infinity Anders Rundgren
- [Cbor] Re: Dealing with -0.0, NaN, and Infinity Anders Rundgren