nim-stew/stew/shims/hashes.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