 // -----------------------------------------------------------------------------
 
 import Foundation
+
+private let i_2166136261 = Int(bitPattern: 2166136261)
+private let i_16777619 = Int(16777619)
 
 fileprivate func serializeAnyJSON(for message: Message, typeURL: String) throws -> String {
   var visitor = try JSONEncodingVisitor(message: message)

      return false
    }

    // If we have both data's, compare those.
    // The best option is to decode and compare the messages; this
    // insulates us from variations in serialization details.  For
    // example, one Any might hold protobuf binary bytes from one
    // language implementation and the other from another language
    // implementation.  But of course this only works if we
    // actually know the message type.
    //if let myMessage = _message {
    //    if let otherMessage = other._message {
    //        ... compare them directly
    //    } else {
    //        ... try to decode other and compare
    //    }
    //} else if let otherMessage = other._message {
    //    ... try to decode ourselves and compare
    //} else {
    //    ... try to decode both and compare
    //}
    // If we don't know the message type, we have few options:
    // If we were both deserialized from proto, compare the binary value:
    // If we were both deserialized from JSON, compare content of the JSON?
    if let myValue = _valueData, let otherValue = other._valueData, myValue == otherValue {
      return true
    }


extension AnyMessageStorage {
  var hashValue: Int {
    var hash: Int = i_2166136261
    if !_typeURL.isEmpty {
      hash = (hash &* i_16777619) ^ _typeURL.hashValue
    }
    // Can't use _valueData for a few reasons:
    // 1. Since decode is done on demand, two objects could be equal
    //    but created differently (one from JSON, one for Message, etc.),
    //    and the hashes have to be equal even if we don't have data yet.
    // 2. map<> serialization order is undefined. At the time of writing
    //    the Swift, Objective-C, and Go runtimes all tend to have random
    //    orders, so the messages could be identical, but in binary form
    //    they could differ.
    return hash
  }

