From a1362d15b7639c7ae2228c020d94ba98c9448ea0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 26 Feb 2012 00:17:22 +0000 Subject: [PATCH] Added hashString() which simply calls mhash() function with SHA256 hash function --- inc/classes/main/class_BaseFrameworkSystem.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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] -- 2.39.5