OpenConceptLab / ocl_issues

Issues for all OCL repos. NOTE: Install ZenHub Browser Extension and request access to the OCL Roadmap board to view all issues and to contribute
4 stars 2 forks source link

Draft checksum documentation (to go into OCL Docs) #1811

Open paynejd opened 7 months ago

paynejd commented 7 months ago

@snyaggarwal

snyaggarwal commented 7 months ago

Fields:

Concepts

Source/Version

Collection/Version

Algorithm:

  1. Cleanup
    • Remove None values
    • Ignore is_active=True and retired=False
    • Ignore empty extras
  2. Serialize
    • Consider a list with a single object equal to a single object without the list, e.g. [element] vs element
    • Sort items in the list
    • Sort keys in dict
    • convert UUID to str (simple str conversion for UUID('xxx-xxxx-..') to 'xxx-xxxx-..')
    • convert the entire payload to str (JSON dump)
  3. Generate MD5 hash from serialized str:
    • encode in UTF-8
    • apply MD5 hash
paynejd commented 7 months ago