AutoHashEquals.type_seed
— Functiontype_seed(x)
Computes a value to use as a seed for computing the hash value of a type.
The constants used in this computation are random numbers produced by Random.rand(Random.RandomDevice(), UInt)
.
AutoHashEquals.@auto_hash_equals
— Macro@auto_hash_equals [options] struct Foo ... end
Generate Base.hash
, Base.isequal
, and Base.==
methods for Foo
.
Options:
cache=true|false
whether or not to generate an extra cache field to store the precomputed hash value. Default:false
.hashfn=myhash
the hash function to use. Default:Base.hash
.fields=a,b,c
the fields to use for hashing and equality. Default: all fields.typearg=true|false
whether or not to make type arguments significant. Default:false
.typeseed=e
Usee
(ore(type)
iftypearg=true
) as the seed for hashing type arguments.compat1=true
To have==
defined by usingisequal
. Default:false
.
AutoHashEquals.Compat.@auto_hash_equals
— Macro@auto_hash_equals [options] struct Foo ... end
Generate Base.hash
, Base.isequal
, and Base.==
methods for Foo
.
Options:
cache=true|false
whether or not to generate an extra cache field to store the precomputed hash value. Default:false
.hashfn=myhash
the hash function to use. Default:Base.hash
.fields=a,b,c
the fields to use for hashing and equality. Default: all fields.typearg=true|false
whether or not to make type arguments significant. Default:false
.typeseed=e
Usee
(ore(type)
iftypearg=true
) as the seed for hashing type arguments.compat1=true
To have==
defined by usingisequal
. Default:true
.