From 794f9527da0dc587c73240f1b8cf2f0511277803 Mon Sep 17 00:00:00 2001 From: Peter Munch-Ellingsen Date: Tue, 29 Mar 2016 18:06:48 +0200 Subject: [PATCH] Changed the JSON object hashing procedure to use a symmetric operator to disregard key order in object hashes --- lib/pure/json.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/json.nim b/lib/pure/json.nim index c5b1a21e93..6da7d6e616 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -786,7 +786,7 @@ proc hash*(n: JsonNode): Hash = proc hash*(n: Table[string, JsonNode]): Hash = for key, val in n: - result = result !& hash(key) !& hash(val) + result = result xor (hash(key) !& hash(val)) result = !$result proc len*(n: JsonNode): int =