]> git.mxchange.org Git - core.git/commitdiff
Added hashString() which simply calls mhash() function with SHA256 hash function
authorRoland Häder <roland@mxchange.org>
Sun, 26 Feb 2012 00:17:22 +0000 (00:17 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 26 Feb 2012 00:17:22 +0000 (00:17 +0000)
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]