Computing an md5 hash of a data structure

后端 未结 7 1766
南旧
南旧 2020-12-04 10:13

I want to compute an md5 hash not of a string, but of an entire data structure. I understand the mechanics of a way to do this (dispatch on the type of the value, canonical

7条回答
  •  爱一瞬间的悲伤
    2020-12-04 10:47

    ROCKY way: Put all your struct items in one parent entity (if not already), recurse and sort/canonicalize/etc them, then calculate the md5 of its repr.

提交回复
热议问题