diff --git a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H
index 413dda4aa4b988b105d09ec253cb2e66442f097b..57cf7af96d0ab72661460c52fb8e231e499f5760 100644
--- a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H
+++ b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H
@@ -52,7 +52,7 @@ Typedef
     Foam::wordHashSet
 
 Description
-    A HashSet with (the default) word keys.
+    A HashSet with word keys and string hasher.
 
 Typedef
     Foam::labelHashSet
@@ -75,12 +75,22 @@ namespace Foam
 
 // Forward Declarations
 template<class T> class MinMax;
+template<class Key, class Hash> class HashSet;
+
+// Common hash-set types
+
+//- A HashSet of words, uses string hasher.
+typedef HashSet<word, Hash<word>> wordHashSet;
+
+//- A HashSet of labels, uses label hasher.
+typedef HashSet<label, Hash<label>> labelHashSet;
+
 
 /*---------------------------------------------------------------------------*\
                            Class HashSet Declaration
 \*---------------------------------------------------------------------------*/
 
-template<class Key=word, class Hash=Foam::Hash<Key>>
+template<class Key, class Hash=Foam::Hash<Key>>
 class HashSet
 :
     public HashTable<zero::null, Key, Hash>
@@ -401,14 +411,7 @@ public:
 };
 
 
-// Typedefs
-
-//- A HashSet with word keys.
-typedef HashSet<word> wordHashSet;
-
-//- A HashSet with label keys and label hasher.
-typedef HashSet<label, Hash<label>> labelHashSet;
-
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 // Global Functions
 
diff --git a/src/OpenFOAM/containers/HashTables/HashTableFwd.H b/src/OpenFOAM/containers/HashTables/HashTableFwd.H
index 786bd653b9251537f0f435afdccd763d975a71a1..dbf9ed7dfd995af98e67a71e6ef38f1c080a6e25 100644
--- a/src/OpenFOAM/containers/HashTables/HashTableFwd.H
+++ b/src/OpenFOAM/containers/HashTables/HashTableFwd.H
@@ -39,9 +39,10 @@ Description
 namespace Foam
 {
 
+template<class Key, class Hash> class HashSet;
+
 template<class T, class Key, class Hash> class HashTable;
 template<class T, class Key, class Hash> class HashPtrTable;
-template<class Key, class Hash> class HashSet;
 
 template<class T> class Map;
 template<class T> class PtrMap;
diff --git a/src/OpenFOAM/expressions/exprString/exprString.H b/src/OpenFOAM/expressions/exprString/exprString.H
index a7aa13f577839eb60f00e08fc88e5c8e0c3d94a4..9a670930f2bcb6850c73bb9f50cddeb8e111a6b7 100644
--- a/src/OpenFOAM/expressions/exprString/exprString.H
+++ b/src/OpenFOAM/expressions/exprString/exprString.H
@@ -5,8 +5,8 @@
     \\  /    A nd           | www.openfoam.com
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
-    Original code Copyright (C) 2012-2018 Bernhard Gschaider
-    Copyright (C) 2019 OpenCFD Ltd.
+    Copyright (C) 2012-2018 Bernhard Gschaider
+    Copyright (C) 2019-2021 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -65,7 +65,7 @@ public:
 
     // Constructors
 
-        //- Construct null
+        //- Default construct
         exprString() = default;
 
         //- Copy construct
@@ -189,6 +189,16 @@ public:
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace expressions
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+//- Hashing for exprString is the same as string
+template<> struct Hash<expressions::exprString> : string::hasher {};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 } // End namespace Foam
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/primitives/hashes/Hash/Hash.H b/src/OpenFOAM/primitives/hashes/Hash/Hash.H
index 5329080bf0c56ae4f52255d82c846eb31478d04d..ec78dc1b579702ae60f07aeff0e1fe3757c7f078 100644
--- a/src/OpenFOAM/primitives/hashes/Hash/Hash.H
+++ b/src/OpenFOAM/primitives/hashes/Hash/Hash.H
@@ -30,12 +30,9 @@ Class
 Description
     Hash function class.
     The default definition is for primitives.
-    Non-primitives used to hash entries on hash tables will likely need
+    Non-primitives used to hash entries on hash tables will need
     a specialized version.
 
-Note
-    The second template parameter (bool) is used for SFINAE overloading,
-
 \*---------------------------------------------------------------------------*/
 
 #ifndef Hash_H
@@ -43,8 +40,6 @@ Note
 
 #include "Hasher.H"
 #include <cstdint>
-#include <string>
-#include <type_traits>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -55,7 +50,7 @@ namespace Foam
                             Class Hash Declaration
 \*---------------------------------------------------------------------------*/
 
-template<class T, class SFINAEType=bool>
+template<class T>
 struct Hash
 {
     unsigned operator()(const T& obj, unsigned seed=0) const
@@ -67,35 +62,7 @@ struct Hash
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-// Specialization for trivial (integer) types
-
-#undef  FOAM_INTHASHER
-#define FOAM_INTHASHER(IntType)                                               \
-    /*! \brief Hashing specialization for IntType */                          \
-    /*! Unseeded (single value) uses natural order, otherwise incremental */  \
-    template<> struct Hash<IntType>                                           \
-    {                                                                         \
-        unsigned operator()(const IntType val) const                          \
-        {                                                                     \
-            return static_cast<unsigned>(val);                                \
-        }                                                                     \
-        unsigned operator()(const IntType val, unsigned seed) const           \
-        {                                                                     \
-            return Foam::Hasher(&val, sizeof(IntType), seed);                 \
-        }                                                                     \
-    }
-
-FOAM_INTHASHER(bool);
-FOAM_INTHASHER(char);
-FOAM_INTHASHER(int32_t);
-FOAM_INTHASHER(int64_t);
-FOAM_INTHASHER(uint32_t);
-
-#undef FOAM_INTHASHER
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-//- Hashing specialization for nullptr. Always 0
+//- Hashing of nullptr, always 0
 template<>
 struct Hash<std::nullptr_t>
 {
@@ -105,7 +72,7 @@ struct Hash<std::nullptr_t>
     }
 };
 
-//- Hashing specialization for pointers, interpret pointer as a integer type
+//- Hashing of pointers, treat as unsigned integer
 template<>
 struct Hash<void*>
 {
@@ -119,20 +86,32 @@ struct Hash<void*>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-//- Hashing partial specialization for derived string types
-template<class StringType>
-struct Hash
-<
-    StringType,
-    typename std::enable_if
-    <std::is_base_of<std::string, StringType>::value, bool>::type
->
-{
-    unsigned operator()(const std::string& str, unsigned seed=0) const
-    {
-        return Foam::Hasher(str.data(), str.length(), seed);
+// Specialization for common integral types
+
+#undef  FOAM_HASH_SPECIALIZATION
+#define FOAM_HASH_SPECIALIZATION(Type)                                        \
+                                                                              \
+    /*! \brief Hashing of integral type: Type */                              \
+    /*! Unseeded (single value) uses natural order, otherwise incremental */  \
+    template<>                                                                \
+    struct Hash<Type>                                                         \
+    {                                                                         \
+        unsigned operator()(const Type val) const                             \
+        {                                                                     \
+            return static_cast<unsigned>(val);                                \
+        }                                                                     \
+        unsigned operator()(const Type val, unsigned seed) const              \
+        {                                                                     \
+            return Foam::Hasher(&val, sizeof(Type), seed);                    \
+        }                                                                     \
     }
-};
+
+FOAM_HASH_SPECIALIZATION(bool);
+FOAM_HASH_SPECIALIZATION(char);
+FOAM_HASH_SPECIALIZATION(int32_t);
+FOAM_HASH_SPECIALIZATION(int64_t);
+FOAM_HASH_SPECIALIZATION(uint32_t);
+#undef FOAM_HASH_SPECIALIZATION
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/primitives/strings/fileName/fileName.H b/src/OpenFOAM/primitives/strings/fileName/fileName.H
index cc1cd4cacff8e2881564129b29265d078035fade..41ef3f9c03f8714fef114cf702ef5b4a7f57f220 100644
--- a/src/OpenFOAM/primitives/strings/fileName/fileName.H
+++ b/src/OpenFOAM/primitives/strings/fileName/fileName.H
@@ -58,10 +58,15 @@ namespace Foam
 // Forward Declarations
 class fileName;
 class token;
+
 template<class T> class List;
 template<class T> class UList;
 typedef List<word> wordList;
 
+//- Hashing for fileName
+template<> struct Hash<fileName> : string::hasher {};
+
+
 /*---------------------------------------------------------------------------*\
                           Class fileName Declaration
 \*---------------------------------------------------------------------------*/
diff --git a/src/OpenFOAM/primitives/strings/keyType/keyType.H b/src/OpenFOAM/primitives/strings/keyType/keyType.H
index 7ed8fe64b6e288d4d5b04be432d6a04e8002139b..bcba95958df50692ebff8cc19ce67ba1baf74973 100644
--- a/src/OpenFOAM/primitives/strings/keyType/keyType.H
+++ b/src/OpenFOAM/primitives/strings/keyType/keyType.H
@@ -58,6 +58,10 @@ class token;
 Istream& operator>>(Istream& is, keyType& val);
 Ostream& operator<<(Ostream& os, const keyType& val);
 
+//- Hashing for keyType
+template<> struct Hash<keyType> : string::hasher {};
+
+
 /*---------------------------------------------------------------------------*\
                            Class keyType Declaration
 \*---------------------------------------------------------------------------*/
@@ -237,6 +241,8 @@ public:
 };
 
 
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 // IOstream Operators
 
 //- Read operator
diff --git a/src/OpenFOAM/primitives/strings/string/string.H b/src/OpenFOAM/primitives/strings/string/string.H
index 52794f905c66274b037a588721e0d2403e5c4829..d5646b4b62ee4b6428e030ee7ed28d01ef6350e4 100644
--- a/src/OpenFOAM/primitives/strings/string/string.H
+++ b/src/OpenFOAM/primitives/strings/string/string.H
@@ -62,11 +62,14 @@ namespace Foam
 {
 
 // Forward Declarations
+class string;
 class word;
 class wordRe;
 class Istream;
 class Ostream;
 
+template<class T> struct Hash;
+
 /*---------------------------------------------------------------------------*\
                            Class string Declaration
 \*---------------------------------------------------------------------------*/
@@ -150,7 +153,8 @@ public:
             }
         };
 
-        //- Hashing functor for string and derived string classes
+        //- Deprecated hashing functor - use hasher
+        //  \deprecated(2021-04) - use hasher
         struct hash : string::hasher {};
 
 
@@ -333,6 +337,17 @@ public:
 };
 
 
+// * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
+
+//- Hashing for Foam::string
+template<> struct Hash<string> : string::hasher {};
+
+//- Hashing for std:::string
+template<> struct Hash<std::string> : string::hasher {};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 // IOstream Operators
 
 //- Read operator
diff --git a/src/OpenFOAM/primitives/strings/word/word.H b/src/OpenFOAM/primitives/strings/word/word.H
index 19d9c2a8742c16a2c2c614924418ca97edb0357e..0332781130bda5bceee30a5764b18660303b665a 100644
--- a/src/OpenFOAM/primitives/strings/word/word.H
+++ b/src/OpenFOAM/primitives/strings/word/word.H
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2016 OpenFOAM Foundation
-    Copyright (C) 2017-2019 OpenCFD Ltd.
+    Copyright (C) 2017-2021 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -55,6 +55,10 @@ class word;
 Istream& operator>>(Istream& is, word& val);
 Ostream& operator<<(Ostream& os, const word& val);
 
+//- Hashing for word
+template<> struct Hash<word> : string::hasher {};
+
+
 /*---------------------------------------------------------------------------*\
                            Class word Declaration
 \*---------------------------------------------------------------------------*/
@@ -204,6 +208,8 @@ public:
 };
 
 
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 // IOstream Operators
 
 //- Read operator
diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H
index c1467d8d428a16d4f3ed32817d59c4509ea8c015..b5b0536e3400c4846abfdd869b4ac80063abcb33 100644
--- a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H
+++ b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H
@@ -70,6 +70,10 @@ class wordRe;
 Istream& operator>>(Istream& is, wordRe& val);
 Ostream& operator<<(Ostream& os, const wordRe& val);
 
+//- Hashing for wordRe
+template<> struct Hash<wordRe> : string::hasher {};
+
+
 /*---------------------------------------------------------------------------*\
                            Class wordRe Declaration
 \*---------------------------------------------------------------------------*/
@@ -249,6 +253,8 @@ public:
 };
 
 
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 // IOstream Operators
 
 //- Read operator
diff --git a/src/fileFormats/ensight/name/ensightFileName.H b/src/fileFormats/ensight/name/ensightFileName.H
index caa47c7ef8bb1dfd4ee795b16bd9acb068ab1bf8..0e15cb19192f96e93d6046798161636cf43f89a8 100644
--- a/src/fileFormats/ensight/name/ensightFileName.H
+++ b/src/fileFormats/ensight/name/ensightFileName.H
@@ -106,6 +106,15 @@ public:
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace ensight
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+//- Hashing for FileName is the same as string
+template<> struct Hash<ensight::FileName> : string::hasher {};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 } // End namespace Foam
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/fileFormats/ensight/name/ensightVarName.H b/src/fileFormats/ensight/name/ensightVarName.H
index 4f6c01f3ece6d36fcc084bd0366bbbb959107440..dab88dd446c37100b58ff9c687732ebb1f2379b6 100644
--- a/src/fileFormats/ensight/name/ensightVarName.H
+++ b/src/fileFormats/ensight/name/ensightVarName.H
@@ -104,6 +104,16 @@ public:
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace ensight
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+//- Hashing for VarName is the same as string
+template<> struct Hash<ensight::VarName> : string::hasher {};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 } // End namespace Foam
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //