Canonicalise lists of JSONs in different order into the same hash

30 Views Asked by At

Given two different JSONs

first = {"number": 1, "color": blue}

and

second = {"number": 2, "color": red}

How could I canonicalise the following to have the same hash?

{"list": [first, second]}
{"list": [second, first]}

I have tried using this RFC 8785 compliant library but it doesn't sort the lists so the hash would end up different.

0

There are 0 best solutions below