Skip to content

Commit

Permalink
ObjectId made hashable
Browse files Browse the repository at this point in the history
  • Loading branch information
Joannis Orlandos committed Sep 26, 2016
1 parent 0efa793 commit a56e210
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/ObjectId.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,11 @@ public struct ObjectId {
}
}

extension ObjectId: Hashable {
/// The hash value for this ObjectId is currently the hexstring. Will be more performant in the future
public var hashValue: Int {
return self.hexString.hashValue
}
}

private let radix16table: [UInt8] = [0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66]

0 comments on commit a56e210

Please sign in to comment.