Sort out hashes for various objects
Closed this issue · 0 comments
hainesm6 commented
Issue/s
- Current MD5 hash system will have collisions, even if they are very unlikely.
- The attributes apart from
seq
used to hash BasicPart and BasicLinker objects don't seem necessary. - Using the id attribute of BasicLinkers and BasicParts objects to create a hash for a ClipReaction object is dangerous given users could give an id to a BasicPart which is the same as an existing part but has a different sequence. Therefore I would recommend using the sequence attribute of the associated BasicPart and BasicLinker objects.
Potential solutions
- Change the way ClipReaction hashes are calculated to use the
seq
attribute as opposed to ID. - Get rid of MD5 hashes in the serialised BasicBuild object. I wonder whether we could use seq objects as keys although I don't know how that would serialise into JSON. If it doesn't do it well, we could internally have a dictionary associate seq objects with integers and use that to populate arrays and provide indexes when we need cross-referencing.