11 lines
181 B
Nim
11 lines
181 B
Nim
|
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
|