JuliaServices / AutoHashEquals.jl

A Julia macro to add == and hash() to composite types.
Other
57 stars 12 forks source link

Add a way to specify the type seed #42

Closed gafter closed 1 year ago

gafter commented 1 year ago

Add a mechanism to specify the "type seed", which is the UInt value that we start with to compute the hash function. Currently, we use either hash(:TypeName) or hash(Type), depending on whether typearg=false (the default) or typearg=true.

One suggestion for how it would work:

The user can specify type_seed=e. If typearg=false (the default), then e is used as the type seed. If typearg=true, then e(t) is used as the type seed, where t is the type of the object being hashed.