Instance Method インスタンスメソッド

hash(into:)

Hashes the essential components of this value by feeding them into the given hasher. この値の本質的な構成要素を、それらをその与えられたhasherへと与えることによって、ハッシュ化します。

Declaration 宣言

func hash(into hasher: inout Hasher)

Parameters パラメータ

hasher

The hasher to use when combining the components of this instance. このインスタンスの構成要素を結合する場合に使うハーシャー。

Discussion 解説

Implement this method to conform to the Hashable protocol. The components used for hashing must be the same as the components compared in your type’s == operator implementation. Call hasher.combine(_:) with each of these components. このメソッドを実装して、Hashableプロトコルに準拠してください。ハッシュ化に使用される構成要素は、あなたの型のもつ==演算子実装において比較される構成要素と同じでなければなりません。hasher.combine(_:)をそれら構成要素とともに呼び出してください。