Add hashes.hashAllFields
This commit is contained in:
parent
a98ec09b0b
commit
2f9c61f485
|
@ -0,0 +1,10 @@
|
|||
import
|
||||
std/[hashes, typetraits]
|
||||
|
||||
func hashAllFields*(x: object|tuple): Hash =
|
||||
mixin hash
|
||||
for f in fields(x):
|
||||
result = result !& hash(f)
|
||||
result = !$result
|
||||
|
||||
export hashes
|
Loading…
Reference in New Issue