Re: [Json] Limitations on number size?

Nico Williams <nico@cryptonector.com> Tue, 04 June 2013 09:03 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9B1ED21F9A9C for <json@ietfa.amsl.com>; Tue, 4 Jun 2013 02:03:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.791
X-Spam-Level:
X-Spam-Status: No, score=-1.791 tagged_above=-999 required=5 tests=[AWL=0.185, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p8OMqVuljlf8 for <json@ietfa.amsl.com>; Tue, 4 Jun 2013 02:03:03 -0700 (PDT)
Received: from homiemail-a66.g.dreamhost.com (caiajhbdcbbj.dreamhost.com [208.97.132.119]) by ietfa.amsl.com (Postfix) with ESMTP id 8574C21F9B75 for <json@ietf.org>; Tue, 4 Jun 2013 00:59:31 -0700 (PDT)
Received: from homiemail-a66.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a66.g.dreamhost.com (Postfix) with ESMTP id 3EC02350078 for <json@ietf.org>; Tue, 4 Jun 2013 00:59:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=q/HBfwpgOHRlK7DY7rvz Tclbbz4=; b=VLEGOoNUjTTO1r5V5Oj7mR4DDz8pV8aFXe++hc5XShRnCEayxErl c9KEQ0LHpSNEhGrmYPgx2uqnWyjcAkX1OFQWU+TEPgKYdPL+Rk/+RoT634s6tAkF Sjms9CZ0XGmp9EhvKiuKQ9QBP52Eh1ceQEm7U5VclUYpAmMLbMqUkZc=
Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a66.g.dreamhost.com (Postfix) with ESMTPSA id D669135005B for <json@ietf.org>; Tue, 4 Jun 2013 00:59:30 -0700 (PDT)
Received: by mail-wg0-f52.google.com with SMTP id z11so4037983wgg.7 for <json@ietf.org>; Tue, 04 Jun 2013 00:59:29 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fAo9Y7zSO+62T8z8vdlqNNvtbWIjz7owLmMULh8EWc8=; b=QZtDE5OuY6q94wU8wl8ugql5Pwrlpd+4Xxj6V3VTVN2CV+icoL7GobLKFGEh7KvBDp rNCWkmv9xAbwjZRUSqwT5HcQnlhR7xY6UcP8PSwzB0htnIjlYORjn8enyGE7n7KLaQRu tKbdcEiLHmaPSHJRbrGjly1NOFivJF/KuNT1aKNbf600kUmt+IPqMEpzcKkm65h3m0yN ejX7dy0PpBHeyIV/yhZuj0DtYnLm3ILMDIVt/amEGbSnz+w1kdrk0Oyem9kkszBZkvQi XQZeRmradtSOrcRRDra9Ju0nvnTFD8j/drXrbDUU1giZeGdBPmhBKhHJRlZMlBjt7Trb Zghg==
MIME-Version: 1.0
X-Received: by 10.180.90.70 with SMTP id bu6mr169739wib.34.1370332769404; Tue, 04 Jun 2013 00:59:29 -0700 (PDT)
Received: by 10.216.63.136 with HTTP; Tue, 4 Jun 2013 00:59:29 -0700 (PDT)
In-Reply-To: <C4D8E604-E4F8-408B-B7DD-97226300C212@tzi.org>
References: <CAK3OfOgPGi4PKxKAGEG=PCv-xaszMqWpUUUH2B9f0UaeMMO1gQ@mail.gmail.com> <C42654A3-E218-45A8-B368-4A60CB89619D@vpnc.org> <C4D8E604-E4F8-408B-B7DD-97226300C212@tzi.org>
Date: Tue, 04 Jun 2013 02:59:29 -0500
Message-ID: <CAK3OfOjDp=S=HZ5LTP3L+rqq1VjhSShakmBOJD9aPiN8fSULKw@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Carsten Bormann <cabo@tzi.org>
Content-Type: multipart/alternative; boundary="f46d043be27af1d04f04de4f7545"
Cc: Paul Hoffman <paul.hoffman@vpnc.org>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Limitations on number size?
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 04 Jun 2013 09:03:26 -0000

On Tuesday, June 4, 2013, Carsten Bormann wrote:

> >>> JavaScript might not, but JSON actually does have indefinite length
> bignums. A JSON number can have any number of decimal digits.
> >>
> >> Yeah, but it is constrained to IEEE 754 64-bit floating point values,
> no?
> >
> > I don't see any limitation in RFC 4627, but it would be interesting if
> other folks here believe there is a limitation as Nico does.
>
> I think this is a nice example of the distinction between JSON the
> representation format, a specific JSON application, and JSON the ecosystem.
>
> JSON the format has no trouble in representing high-precision numbers (and
> big integers).
> So if somebody wanted to send ECDSA signature r/s values as JSON numbers,
> the format would be fine.


This is a plausible answer, sure.  I'm not sure I'd want to say JSON can
only represent IEEE754 64-bit numbers either, so if this is the consensus
then that'll be fine by me.

Do note that JSON's number encoding is indefinite-length...  ;)

Nico
--