From: Roland Häder Date: Sun, 26 Feb 2012 00:17:22 +0000 (+0000) Subject: Added hashString() which simply calls mhash() function with SHA256 hash function X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a1362d15b7639c7ae2228c020d94ba98c9448ea0;p=core.git Added hashString() which simply calls mhash() function with SHA256 hash function --- diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index cf137a7d..3c9dcb28 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -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]