ethernet_interface: Refactor object hashing

Change-Id: Ic1022410fea18be5508c8fa08a27e4ae1a2d51e0
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/types.hpp b/src/types.hpp
index 58ad04a..9eeb3b7 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -64,5 +64,17 @@
 using string_uset =
     std::unordered_set<std::string, string_hash, std::equal_to<>>;
 
+constexpr std::size_t hash_multi()
+{
+    return 0;
+}
+
+template <typename T, typename... Args>
+constexpr std::size_t hash_multi(const T& v, Args... args)
+{
+    const std::size_t seed = hash_multi(args...);
+    return seed ^ (std::hash<T>{}(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2));
+}
+
 } // namespace network
 } // namespace phosphor