Re: [Json] Canonicalization

Francis Galiegue <fgaliegue@gmail.com> Wed, 20 February 2013 23:31 UTC

Return-Path: <fgaliegue@gmail.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 86CCC21E803A for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 15:31:53 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.54
X-Spam-Level:
X-Spam-Status: No, score=-3.54 tagged_above=-999 required=5 tests=[AWL=0.059, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iUqkMf6ZeJbh for <json@ietfa.amsl.com>; Wed, 20 Feb 2013 15:31:53 -0800 (PST)
Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by ietfa.amsl.com (Postfix) with ESMTP id AC68021E8037 for <json@ietf.org>; Wed, 20 Feb 2013 15:31:52 -0800 (PST)
Received: by mail-ee0-f49.google.com with SMTP id d4so4317134eek.22 for <json@ietf.org>; Wed, 20 Feb 2013 15:31:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=e/HGvWPlYKUXIQYU6xEqUzNIhdn7PpUhV1aqKMQL8KA=; b=JowtVKDjGVwcFrWN4GYzX8z+zTEOV07jmgU0tGYyscMAcq7YIjqMzHMgmhqnF5wwJ6 /AXlrCaZbSF05LCkUbeIPSrCj8qNZ1Alhhq+b1DwNCO7T2OZeYZPoplH1OwhYmRE8QFC sWCRFXxyNZ7oBbbMLCWQJakZdbkWzFxq9FGWVD6plo1AszvFjZHr4NU2MSAABTWT+Uqk lGH0Dm2G7SjKvfFZY/xdZJw3fbs10YPRWhpV81GoYXLzBAPFcDh/JCFSOUSU4Pw7PkMI mo5umXzH7QGrgQGRehr/bjUumORlkZqvYQ/NT6L/VbYWWCZ8KJcvHjlLn864sn9JvEoR Uakg==
MIME-Version: 1.0
X-Received: by 10.14.209.131 with SMTP id s3mr73772902eeo.26.1361403111736; Wed, 20 Feb 2013 15:31:51 -0800 (PST)
Received: by 10.14.1.7 with HTTP; Wed, 20 Feb 2013 15:31:51 -0800 (PST)
In-Reply-To: <255B9BB34FB7D647A506DC292726F6E11507634CD2@WSMSG3153V.srv.dir.telstra.com>
References: <BF7E36B9C495A6468E8EC573603ED9411513E818@xmb-aln-x11.cisco.com> <A723FC6ECC552A4D8C8249D9E07425A70F897263@xmb-rcd-x10.cisco.com> <255B9BB34FB7D647A506DC292726F6E11507579808@WSMSG3153V.srv.dir.telstra.com> <255B9BB34FB7D647A506DC292726F6E11507634C37@WSMSG3153V.srv.dir.telstra.com> <CALcybBA5ED=qj-=DXMuH_2A=d3VpkRV6KM8vtu62shRxvhm+hA@mail.gmail.com> <255B9BB34FB7D647A506DC292726F6E11507634CD2@WSMSG3153V.srv.dir.telstra.com>
Date: Thu, 21 Feb 2013 00:31:51 +0100
Message-ID: <CALcybBBUowq6sO=vumbDutbYsKw_k8MUvYRtWJqEBfAzyNWzVg@mail.gmail.com>
From: Francis Galiegue <fgaliegue@gmail.com>
To: "Manger, James H" <James.H.Manger@team.telstra.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: "draft-staykov-hu-json-canonical-form@tools.ietf.org" <draft-staykov-hu-json-canonical-form@tools.ietf.org>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Canonicalization
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "Discussion related to JavaScript Object Notation \(JSON\)." <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: Wed, 20 Feb 2013 23:31:53 -0000

On Thu, Feb 21, 2013 at 12:20 AM, Manger, James H
<James.H.Manger@team.telstra.com> wrote:
[...]
>
> Done (almost).
>
> The JSON.stringify format for numbers is NOT limited to 64-bit floats. It effectively says format the number without an exponent if it is in the range [1e-6, 1e21); otherwise format it with 1 digit before the decimal point. There is no limit to the number of digits, ie the precision.
>

Well, I can tell you that it _is_ limited...

Go to the site in my signature, try this:

{
    "maximum": 209098901232398109823091823.2983908091823098098019283019823098,
    "exclusiveMaximum": true
}

as a schema, and as data, input:

209098901232398109823091823.29839080918230980980192830198230981

As I use a language which has the capability to deal with such
numbers, this answers false -- but I use JSON.stringify() to format
the results of validation: look at how the numbers are formatted.

--
Francis Galiegue, fgaliegue@gmail.com
Try out your JSON Schemas: http://json-schema-validator.herokuapp.com