diff options
author | Araq <rumpf_a@web.de> | 2013-05-08 16:12:33 -0700 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-05-08 16:12:33 -0700 |
commit | 2b600bbaa67f7bd73f37634e58e41cd55d4fa7b5 (patch) | |
tree | e2257c027688d2cafa53da15a99bac25c18db557 | |
parent | 44c4b945eb8e5255aa128dad2553e290eebdd24b (diff) | |
parent | cc887bf66e3df40babd29e89e45c71e2e3cca079 (diff) | |
download | Nim-2b600bbaa67f7bd73f37634e58e41cd55d4fa7b5.tar.gz |
Merge pull request #418 from fowlmouth/patch-5
add hashing for seqs
-rw-r--r-- | lib/pure/hashes.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim index cf0777ff7..8a3135f89 100644 --- a/lib/pure/hashes.nim +++ b/lib/pure/hashes.nim @@ -126,3 +126,6 @@ proc hash*(x: float): THash {.inline.} = var y = x + 1.0 result = cast[ptr THash](addr(y))[] +proc hash*[A](x: openarray[A]): THash = + for it in items(x): result = result !& hash(it) + result = !$result |