Changed the JSON object hashing procedure to use a symmetric operator to disregard key order in object hashes
This commit is contained in:
parent
232d042731
commit
794f9527da
1 changed files with 1 additions and 1 deletions
|
|
@ -786,7 +786,7 @@ proc hash*(n: JsonNode): Hash =
|
||||||
|
|
||||||
proc hash*(n: Table[string, JsonNode]): Hash =
|
proc hash*(n: Table[string, JsonNode]): Hash =
|
||||||
for key, val in n:
|
for key, val in n:
|
||||||
result = result !& hash(key) !& hash(val)
|
result = result xor (hash(key) !& hash(val))
|
||||||
result = !$result
|
result = !$result
|
||||||
|
|
||||||
proc len*(n: JsonNode): int =
|
proc len*(n: JsonNode): int =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue