Re: [Json] The names within an object SHOULD be unique.

Tatu Saloranta <tsaloranta@gmail.com> Thu, 06 June 2013 23:17 UTC

Return-Path: <tsaloranta@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 A0FD721F971F for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 16:17:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.243
X-Spam-Level:
X-Spam-Status: No, score=-2.243 tagged_above=-999 required=5 tests=[AWL=0.356, BAYES_00=-2.599, HTML_MESSAGE=0.001, NO_RELAYS=-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 JIbxneWennJp for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 16:17:14 -0700 (PDT)
Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) by ietfa.amsl.com (Postfix) with ESMTP id 8F37521F9927 for <json@ietf.org>; Thu, 6 Jun 2013 16:17:04 -0700 (PDT)
Received: by mail-we0-f177.google.com with SMTP id m19so2460596wev.8 for <json@ietf.org>; Thu, 06 Jun 2013 16:17:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=P9o8rv0qrbIbgUPOWn6G0yVsjjRXp6VdnpBl23Of7Sg=; b=Sm6HWKNCtN0XstgJXygPLsETbGyEXqJg0Jwb/RvEefNhRo75dNaVlGzbOpj+eQifJp g1OHHa5UqnfLJKL4t5kMl9ZHjepEr3LkvmwaZocE+4g5NFu3di80MzJm7f0Dtde5f9gD dbHCi1Uzvo8dAblI6l+VjtA+o81IaKp115CxBWII9Ix+n2s5Zm0BGPsOkBFlMCeBfyYb ivXkNSif6tCJyyaAI/vA8qKPEk8r7Arwv1a+vIVn0/Dnb9IUGlXwPKMmH8gleMpNK04J x9L1TW2nC+HoXAjifGoNugVP9z+rMXjPdHu+TIJMjFkotAtOnWJmfhWrnhI9FrKey9IY 1IKg==
MIME-Version: 1.0
X-Received: by 10.194.90.244 with SMTP id bz20mr2574120wjb.69.1370560624346; Thu, 06 Jun 2013 16:17:04 -0700 (PDT)
Received: by 10.227.97.6 with HTTP; Thu, 6 Jun 2013 16:17:04 -0700 (PDT)
In-Reply-To: <20130606223711.GN3090@mercury.ccil.org>
References: <51AF8479.5080002@crockford.com> <CAK3OfOgtYoPRZ-Gj5G8AnNipDyxYs=6_KD=rQTxKbhDPX6FZNA@mail.gmail.com> <20130606223711.GN3090@mercury.ccil.org>
Date: Thu, 06 Jun 2013 16:17:04 -0700
Message-ID: <CAGrxA27HOpAbNhr3fs5NWf65q9oZpTM_tR0uB4gEmZEaiKSpxQ@mail.gmail.com>
From: Tatu Saloranta <tsaloranta@gmail.com>
To: John Cowan <cowan@mercury.ccil.org>
Content-Type: multipart/alternative; boundary="047d7bfd090a28518f04de8483df"
Cc: Nico Williams <nico@cryptonector.com>, Douglas Crockford <douglas@crockford.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] The names within an object SHOULD be unique.
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: Thu, 06 Jun 2013 23:17:14 -0000

On Thu, Jun 6, 2013 at 3:37 PM, John Cowan <cowan@mercury.ccil.org> wrote:

> Nico Williams scripsit:
>
> > Thinking of encoders that do not have full knowledge of an object as
> > it is encoded, I'm uncomfortable with saying "MUST NOT send duplicate
> > keys", since determining whether a given key has already been sent
> > might require large amounts of state.  But note that this concern also
> > applies to parsers!
>
> The amount of state can be reduced probabilistically by storing hashes
> of the values rather than the values themselves
>


But hashes would only allow finding potential duplicates, and one still has
to verify with real Strings. I don't see a way around false positives.

-+ Tatu +-