Re: [Json] I-D Action: draft-ietf-json-i-json-01.txt

Jacob Davies <jacob@well.com> Tue, 17 June 2014 22:49 UTC

Return-Path: <cromis@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 973C21A008F for <json@ietfa.amsl.com>; Tue, 17 Jun 2014 15:49:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.278
X-Spam-Level:
X-Spam-Status: No, score=-1.278 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=no
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 50nFnxf5KHnn for <json@ietfa.amsl.com>; Tue, 17 Jun 2014 15:49:06 -0700 (PDT)
Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6D8AE1A00FC for <json@ietf.org>; Tue, 17 Jun 2014 15:49:06 -0700 (PDT)
Received: by mail-ie0-f180.google.com with SMTP id rl12so23868iec.39 for <json@ietf.org>; Tue, 17 Jun 2014 15:49:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=knLA+SbLZsdoD6lR0FlvkCLa+bD+pS0XYr7f7+W3qEk=; b=ylIpBdp1HEl4mQ3QFoSqDJPefALHRHpEVew3nvBW7lCAAwhJybJ8LB09QfBaVWeZwp 0WImwy8eZYcgwWYlJu8bQrxZgJ2AASdIJZqvAPBRPDfuxcWsOpba89xVLOu+zfIptmu8 bjjQwEfLR5R6/y8tKXIS6CpgtcOascoYmvpg6BpvAS/BhWr7LPmrrwAx7NsWUerQCb94 Cb8fOgTwaxVr9aEFMDHvqbDP6uoUDf2+ZQzav3NL3YuxNPgFYjMl+v++9F4bqHcaAyuV ex9SFTyn4pY9lilgPtk7lr6VvIMxFZ7QEO1qTN3MwELwI0X+MLNdYCWohj52kjI7Oaxk JVlQ==
X-Received: by 10.42.37.199 with SMTP id z7mr12996691icd.11.1403045345815; Tue, 17 Jun 2014 15:49:05 -0700 (PDT)
MIME-Version: 1.0
Sender: cromis@gmail.com
Received: by 10.50.243.50 with HTTP; Tue, 17 Jun 2014 15:48:45 -0700 (PDT)
In-Reply-To: <20140617193013.GD29802@mercury.ccil.org>
References: <20140613195805.1386.5992.idtracker@ietfa.amsl.com> <CAHBU6ivy-aVuSZPQ1gMp0bXW0yMYq9Vhi1Bydb809rfBR_ag=g@mail.gmail.com> <CFC1BCB7.4FE64%jhildebr@cisco.com> <CAHBU6isENp-JVJ6FVuhrKNsoWqq94dpzYBos0zGGrh9b6UwW2w@mail.gmail.com> <20140617193013.GD29802@mercury.ccil.org>
From: Jacob Davies <jacob@well.com>
Date: Tue, 17 Jun 2014 15:48:45 -0700
X-Google-Sender-Auth: IZ543W71u7TBY8VQoOvmvKPnrNg
Message-ID: <CAO1wJ5Rz2uDQ3-w=QESDmAo-tRAJdWSCasWkQx9n5NB8dS-+OQ@mail.gmail.com>
To: John Cowan <cowan@mercury.ccil.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: http://mailarchive.ietf.org/arch/msg/json/FHCkfNEE_a1Md1hLI400K6cDmoU
Cc: Tim Bray <tbray@textuality.com>, "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] I-D Action: draft-ietf-json-i-json-01.txt
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
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, 17 Jun 2014 22:49:07 -0000

"For applications such as cryptography, where exact interchange of
much larger numbers is required, it is RECOMMENDED to encode them in
JSON string values."

The phrasing of "it is recommended to encode them" seems awkward to
me. Maybe "it is recommended that such values be encoded as"?

"encoded" also seems off. Maybe "written", "stored", "represented"?

I am not sure that cryptography is the right example. The most common
surprising case will be people trying to store arbitrary 64-bit
integers from commonplace types like Java longs and finding that most
of the value range can't be read & correctly represented in
Javascript. Those numbers might come from 64-bit hashes or storage
systems that assign evenly-distributed 64-bit IDs.

Cryptographic applications deal with much larger numbers, and are
already accustomed to exchanging them as binary, hex, or base64. I
doubt anyone would really even think of trying to send a 2048-bit key
as a JSON number.

On Tue, Jun 17, 2014 at 12:30 PM, John Cowan <cowan@mercury.ccil.org> wrote:
> Tim Bray scripsit:
>
>> > s2.2, "For applications such as cryptography, where exact interchange of
>> > much larger numbers is required, it is RECOMMENDED to encode them in JSON
>> > string values", I suggest adding some guidance on encoding if we have a
>> > quick consensus on decimal|hex|base64url|etc.  Otherwise leaving it as-is
>> > works.  Note that JOSE chose base64url for good reason.
>>
>> Not sure I get this... for big numbers, it’s just digits, right?
>
> Yes, but digits of what base?  Decimal, ça va sans dire; but it goes
> even better when it is said.
>
> --
> John Cowan          http://www.ccil.org/~cowan        cowan@ccil.org
> You cannot enter here.  Go back to the abyss prepared for you!  Go back!
> Fall into the nothingness that awaits you and your Master.  Go! --Gandalf
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json