Closed willow-ahrens closed 1 year ago
https://github.com/beacon-biosignals/StableHashTraits.jl#avoiding-type-piracy has some tips for changing the default hash for types in your context. Something like
struct MyContext end
StableHashTraits.hash_method(::Any, ::MyContext) = UseProperties(:ByOrder)
stable_hash(x; context=MyContext())
We're considering making this change for the default context in #22
Closed by #24
Hello! I greatly appreciate this package! would it be possible to change the default hash in a given context? So many datatypes don't have
write
defined (nor does it really make sense to define it). A better default for me would beUseQualifiedName(UseProperties())
, and only usingwrite
on isbits types. Similarly, defaulting towrite
sometimes leads to collisions when two objects have different types but the same binary representation, and I'd like to include the type of the object in the hash by default. Any tips?