@@ -66,11 +66,11 @@ Swift 4.2
66
66
The standard library now uses a high-quality, randomly seeded, universal
67
67
hash function, represented by the new public ` Hasher ` struct.
68
68
69
- “Random seeding” means that ` hashValue ` properties will return different
70
- values on each execution of a Swift program. This is an important tool for
71
- improving the reliability of the standard library’s hashing collections,
72
- ` Set ` and ` Dictionary ` . In particular, random seeding enables better
73
- protection against (accidental or deliberate) hash-flooding attacks.
69
+ “Random seeding” varies the result of ` hashValue ` on each execution of a
70
+ Swift program, improving the reliability of the standard library's hashed
71
+ collections such as ` Set ` and ` Dictionary ` . In particular, random seeding
72
+ enables better protection against (accidental or deliberate) hash-flooding
73
+ attacks.
74
74
75
75
This change fulfills a long-standing prophecy in Hashable's documentation:
76
76
@@ -111,10 +111,10 @@ Swift 4.2
111
111
implementations above are equivalent to the ones synthesized by the
112
112
compiler, and can be removed without changing the meaning of the code.
113
113
114
- Automatic synthesis has also been extended to support deriving `hashValue`
115
- from `hash (into: )`, and vice versa. Therefore, code that only implements
116
- `hashValue` continues to work in Swift 4.2 . This new functionality works for
117
- all types that can implement `Hashable `, including classes.
114
+ Synthesis has also been extended to support deriving `hashValue` from
115
+ `hash (into: )`, and vice versa. Therefore, code that only implements
116
+ `hashValue` continues to work in Swift 4.2 . This new compiler functionality
117
+ works for all types that can implement `Hashable `, including classes.
118
118
119
119
Note that these changes don't affect Foundation's hashing interface. Classes
120
120
that subclass `NSObject` should override the `hash` property, like before.
0 commit comments