nim-stew/stew/shims/hashes.nim

11 lines
181 B
Nim
Raw Normal View History

2021-12-02 18:00:53 +00:00
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