diff options
author | Peter Munch-Ellingsen <peterme@peterme.net> | 2016-03-29 18:06:48 +0200 |
---|---|---|
committer | Peter Munch-Ellingsen <peterme@peterme.net> | 2016-03-29 18:06:48 +0200 |
commit | 794f9527da0dc587c73240f1b8cf2f0511277803 (patch) | |
tree | d6bda2dac4bfe0aecb5e0f333e3d8298ceeff207 /lib | |
parent | 232d042731589335f65ca3b5d6b41faf2df42ba4 (diff) | |
download | Nim-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.nim | 2 |
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 = |