summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorPeter Munch-Ellingsen <peterme@peterme.net>2016-03-29 18:06:48 +0200
committerPeter Munch-Ellingsen <peterme@peterme.net>2016-03-29 18:06:48 +0200
commit794f9527da0dc587c73240f1b8cf2f0511277803 (patch)
treed6bda2dac4bfe0aecb5e0f333e3d8298ceeff207 /lib
parent232d042731589335f65ca3b5d6b41faf2df42ba4 (diff)
downloadNim-794f9527da0dc587c73240f1b8cf2f0511277803.tar.gz
Changed the JSON object hashing procedure to use a symmetric operator to disregard key order in object hashes
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/json.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/json.nim b/lib/pure/json.nim
index c5b1a21e9..6da7d6e61 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 =