add hashing for seqs
This commit is contained in:
parent
05fd46cdd1
commit
6aabf9b7dd
1 changed files with 3 additions and 0 deletions
|
|
@ -126,3 +126,6 @@ proc hash*(x: float): THash {.inline.} =
|
||||||
var y = x + 1.0
|
var y = x + 1.0
|
||||||
result = cast[ptr THash](addr(y))[]
|
result = cast[ptr THash](addr(y))[]
|
||||||
|
|
||||||
|
proc hash*[A](x: seq[A]): THash =
|
||||||
|
for it in items(x): result = result !& hash(it)
|
||||||
|
result = !$result
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue