Replies: 2 comments 1 reply
-
The library uses |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok thanks, that makes sense. I need a platform independent-hash - I will try to convert the json to string and create a platform-independent hash of that string. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a brief question, caused by the documentation provided here for the hash function of the library:
https://json.nlohmann.me/api/basic_json/std_hash/
In the example, it is noted that
Output:
hash(null) = 2654435769
...
hash({"hello": "world"}) = 4469488738203676328
Note the output is platform-dependent.
I an confused by this remark. Does it mean that the hash of a certain json object (e.g. one read from a file) will be different on different platforms?
If yes, why would that be? Is there any way to ensure that hashes will be the same when compiling on different platforms, e.g. windows(MSVC) and linux (GCC)?
Beta Was this translation helpful? Give feedback.
All reactions