]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - extlib/Auth/OpenID/CryptUtil.php
Updating Janrain OpenID auth library
[quix0rs-gnu-social.git] / extlib / Auth / OpenID / CryptUtil.php
index a92626777932757074c39550f803f0faf802595a..3c60cea170037da51154ac871e75ce7c8daf2c0f 100644 (file)
@@ -104,5 +104,19 @@ class Auth_OpenID_CryptUtil {
 
         return $str;
     }
+
+    static function constEq($s1, $s2)
+    {
+        if (strlen($s1) != strlen($s2)) {
+            return false;
+        }
+
+        $result = true;
+        $length = strlen($s1);
+        for ($i = 0; $i < $length; $i++) {
+            $result &= ($s1[$i] == $s2[$i]);
+        }
+        return $result;
+    }
 }