Skip to content

Commit

Permalink
made UUID Hashable
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Apr 2, 2016
1 parent 11ccab5 commit dc2e7a3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources/UUID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ public func == (lhs: Bluetooth.UUID, rhs: Bluetooth.UUID) -> Bool {
}
}

// MARK: - Hashable

extension Bluetooth.UUID: Hashable {

public var hashValue: Int {

switch self {

case let .Bit16(value): return value.hashValue
case let .Bit128(value): return value.hashValue
}
}
}

// MARK: - DataConvertible

extension Bluetooth.UUID: DataConvertible {
Expand Down

0 comments on commit dc2e7a3

Please sign in to comment.