diff --git a/lib/SimpleSAML/Auth/TimeLimitedToken.php b/lib/SimpleSAML/Auth/TimeLimitedToken.php
index 0fd02dd4f05ffe6ccf686490c9ae1e18edb487df..920dd2d1269d0ae452f5910fa358ba77e23c8ab7 100644
--- a/lib/SimpleSAML/Auth/TimeLimitedToken.php
+++ b/lib/SimpleSAML/Auth/TimeLimitedToken.php
@@ -130,7 +130,7 @@ class TimeLimitedToken
         if (count($splittoken) !== 2) {
             return false;
         }
-        $offset = hexdec($splittoken[0]);
+        $offset = intval(hexdec($splittoken[0]));
         $value = $splittoken[1];
         return ($this->calculateTokenValue($offset) === $value);
     }