mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
Build a 64-bit value
This commit is contained in:
parent
42121160c9
commit
902593d2ae
@ -58,7 +58,19 @@ extension OID: Printable {
|
||||
|
||||
extension OID: Hashable {
|
||||
public var hashValue: Int {
|
||||
return Int(self.oid.id.0) ^ Int(self.oid.id.1) ^ Int(self.oid.id.2)
|
||||
let bytes = [
|
||||
self.oid.id.0,
|
||||
self.oid.id.1,
|
||||
self.oid.id.2,
|
||||
self.oid.id.3,
|
||||
self.oid.id.4,
|
||||
self.oid.id.5,
|
||||
self.oid.id.6,
|
||||
self.oid.id.7
|
||||
]
|
||||
return reduce(bytes, 0, { (hash, byte) in
|
||||
return Int(hash << 8) | Int(byte)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user