Added == operator for comparing two Object IDs

This commit is contained in:
Rostyslav Dzinko
2015-09-08 11:16:22 +03:00
parent 7ff87df56c
commit bd12b7de96

View File

@@ -25,6 +25,10 @@ type
{.deprecated: [Toid: Oid].}
proc `==`*(oid1: Oid, oid2: Oid): bool =
## Compare two Mongo Object IDs for equality
return (oid1.time == oid2.time) and (oid1.fuzz == oid2.fuzz) and (oid1.count == oid2.count)
proc hexbyte*(hex: char): int =
case hex
of '0'..'9': result = (ord(hex) - ord('0'))