You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do ya'll think about adding a CustomHash class which streamlines the creation of non-default hash types.
It could possibly derive from cybox.common.Hash but set the type_ field to an instance of cybox.common.String rather than cybox.common.VocabString (I'm not positive that'd work as planned).
It's not difficult to override the xsi:type, but it requires some in depth knoweldge of the data model and XML:
h=Hash("deadbeef", 'FOOHASH')
h.type_.xsi_type=None# this is a bit trickyprinth.to_xml()
What about just adding a add_custom_hash() function to the HashList (and maybe types that use it, such as File)? I don't like adding more classes that aren't actual CybOX types (things like EmailAddress continually cause trouble).
Activity
gtback commentedon Feb 25, 2015
What about just adding a
add_custom_hash()function to theHashList(and maybe types that use it, such asFile)? I don't like adding more classes that aren't actual CybOX types (things likeEmailAddresscontinually cause trouble).bworrell commentedon Feb 25, 2015
Sure! I'm not married to the class-based approach and was mostly just brain dumping :)