title: How should I compute an hashValue?
body: <p>I saw several examples of implementations of the <code>Hashable</code> variable <code>hashValue</code>, such as these:</p>
  
  <pre><code>extension Country: Hashable {
    var hashValue: Int {
      return name.hashValue ^ capital.hashValue ^ visited.hashValue
    }
  }
  
  
  var hashValue: Int {
      return self.scalarArray.reduce(5381) {
          ($0 &lt;&lt; 5) &amp;+ $0 &amp;+ Int($1)
      }
  }
  
  
  var hashValue : Int {
      get {
          return String(self.scalarArray.map { UnicodeScalar($0) }).hashValue
      }
  }
  </code></pre>
  
  <p>and so on.
  In some cases <code>OR</code>, <code>XOR</code> or <code>BITWISE</code> operators are used. In other cases, other algorithms, map or filter functions etc. </p>
  
  <p>Now I'm a bit confused. What is the rule of thumb to compute a good hashValue? </p>
  
  <p>In the simplest case with two string variables, should I combine these two with an OR operator?</p>