mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 07:43:26 +00:00
Changed the JSON object hashing procedure to use a symmetric operator to disregard key order in object hashes
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user