Re: [Cbor] Encoding Arbitrary Time Ratios

Emile Cormier <emile.cormier.jr@gmail.com> Sun, 04 April 2021 17:06 UTC

Return-Path: <emile.cormier.jr@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 43FB83A10E9 for <cbor@ietfa.amsl.com>; Sun, 4 Apr 2021 10:06:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GkjxIRpPmKUw for <cbor@ietfa.amsl.com>; Sun, 4 Apr 2021 10:06:00 -0700 (PDT)
Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 687183A10E8 for <cbor@ietf.org>; Sun, 4 Apr 2021 10:06:00 -0700 (PDT)
Received: by mail-pj1-x1033.google.com with SMTP id lr1-20020a17090b4b81b02900ea0a3f38c1so7503635pjb.0 for <cbor@ietf.org>; Sun, 04 Apr 2021 10:06:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J23yLcfYAy1ou0Ub+Iu2WMz2LZdcbMYzhxOEcVR1KqM=; b=aMXP+O9YTaPG0a1C1CNeF1ekzhoDAI2L5HftV+8Wvxh1lVVqA1oAcvGpiU1qR2nODm ui7vmq93GxWLVjQGofN2VcMUhlehhR3TuwTZ7LzLOUbyX8TY47WLQUfK77X5fAq9xC0g zqEzoRPwQEJe14Zi1ZuhYSvhSVpTbOdD9qUCOBAsFvifk90OSJSs7Kd+9uwu2/wbPg86 jIXF7PXyCC6pRnYcm3lAjX4wQ0ht1uzpEk0MD33GwteK3juyuPl6kL8jFBmo1ZhiT21o pc5KgExIyEyF8RoigXdrvqyDO1PxkMfps+NU3ZomAZ06QNalz6+I278ePe+rMhZBDE54 1+CQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J23yLcfYAy1ou0Ub+Iu2WMz2LZdcbMYzhxOEcVR1KqM=; b=jOW7v10tuDIsboQOB3/CEm9gUiVtbJ9XCybzMkz1gPlYeizu5VxoiHq/oq6DVv8+Aw ncpwOhvbjqyqRQmsPyFh0s1Z6Mbmtq3f8B4uMR+mUY88wwoCWPNzEKTxKkMOO4NwFxHJ rovGmb2KRKK1CJiVGqnwg8z0mIk/+QLh0uQc3B/DLX1gI3FPnxA0mqkJN5MCylS626xG VsMRuhIrzH/TWtzJ60Faphfa4ndXdArKftj5X+YmYfR+Xo1GgKrz9LXq3yTbioq3EERR mst+jPpms7Vi/h+Vbb9M+nfOfpzyN0TY7MC6hHT+Ie994o0WnIQQ+3+7VV0/LQvURVYd epcw==
X-Gm-Message-State: AOAM5336Hr5Mjm5MH8NDRiiXj/sEISQJnqK99of9/On55fnBcbckqtg3 +2h6E7ExetzDE/oULPPzzORL5oTB5kStoLhJ+sU=
X-Google-Smtp-Source: ABdhPJw4ppDWp/tahvbXQKlM1d7YKcXbABRsQIsIuJhhiEsKI5846PnX5nzdHO0uSg/v+OeXG4skvf4puVfILrmPn18=
X-Received: by 2002:a17:90b:16cd:: with SMTP id iy13mr23373833pjb.46.1617555959108; Sun, 04 Apr 2021 10:05:59 -0700 (PDT)
MIME-Version: 1.0
References: <CAM70yxBF2XeewhsXOGv06kTVitz1kNHkYLHGqm3gX0Vyc2c2YA@mail.gmail.com> <A96FD12B-2F8B-495B-83F1-4A0F50DAA12C@tzi.org> <CAM70yxCaOps1n7pLo_BPR0_ggZ_QbJnY-jsNPw2NYPfP=psihg@mail.gmail.com> <C354E68B-0B1A-4644-AB38-67453F8A52C3@tzi.org>
In-Reply-To: <C354E68B-0B1A-4644-AB38-67453F8A52C3@tzi.org>
From: Emile Cormier <emile.cormier.jr@gmail.com>
Date: Sun, 04 Apr 2021 14:05:48 -0300
Message-ID: <CAM70yxCZ2OJwUEbu1ARUCG4FPZKjZ4f4LG0QPnJ8tOFKfUu-Ag@mail.gmail.com>
To: Carsten Bormann <cabo@tzi.org>
Cc: cbor@ietf.org
Content-Type: multipart/alternative; boundary="00000000000058d85505bf289835"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/zvuE3drIR5bwGhWicxc09n5hTaA>
Subject: Re: [Cbor] Encoding Arbitrary Time Ratios
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 04 Apr 2021 17:06:05 -0000

On Sun, Apr 4, 2021 at 5:38 AM Carsten Bormann <cabo@tzi.org> wrote:

>
> I've just had another idea... a denominator of zero (or possibly null)
> could be a magic value used to indicate that the numerator is a base 10
> exponent. This could allow a more compact representation when the ratio is
> milliseconds, nanoseconds etc. Eg [123, -9, 0] instead of [123, 1,
> 1000000000] for expressing 123ns.
>
>
> We already have decimal fractions (tag 4), so this is covered.
>

I overlooked tag 4 for that purpose. Thanks for reminding me.


> I'm wondering if a new C*N/D tag could be useful in application domains
> outside of timekeeping. It could be called something like "scaled ratio".
>
>
> Probably.
> Making it amenable to cbor-packed suffix (or circumfix!) compression would
> make this a quite versatile tool.
>
>
Are you referring to https://tools.ietf.org/html/draft-ietf-cbor-packed-02
? I wasn't aware of its existence before this.