Given what I think is an identical Swift UUID, I get different hashValue
s for it on subsequent runs of the code. Within a single run it's consistent.
eg:
func UUIDTest() {
let uuid = UUID(uuidString: "00000000-0000-0000-0000-000000000001")
let h = uuid.hashValue
print("\(String(describing: uuid)) -> \(h)")
/*
Run #1:
Optional(00000000-0000-0000-0000-000000000001) -> 8072320274727128679
Run #2:
Optional(00000000-0000-0000-0000-000000000001) -> -2566074080105686496
*/
}
The documentation is mum on whether the hash-value is a function strictly of the UUID, or if there's another ingredient as well.
Is there some understanding about Hashable that I don't have yet?