]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/class_BaseFrameworkSystem.php
Added hashString() which simply calls mhash() function with SHA256 hash function
[core.git] / inc / classes / main / class_BaseFrameworkSystem.php
index cf137a7d3fd345a13eb3062920fb2edab15aebd7..3c9dcb2873050c9944189a95a908fdae6ec95071 100644 (file)
@@ -1974,6 +1974,20 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // And return it
                return $executionTime;
        }
+
+       /**
+        * Hashes a given string with a simple but stronger hash function (no salts)
+        *
+        * @param       $str    The string to be hashed
+        * @return      $hash   The hash from string $str
+        */
+       public function hashString ($str) {
+               // Hash given string with (better secure) hasher
+               $hash = mhash(MHASH_SHA256, $str);
+
+               // Return it
+               return $hash;
+       }
 }
 
 // [EOF]