diff --git a/src/Poche/Util/Token.php b/src/Poche/Util/Token.php index c6c32b0..598ac2b 100644 --- a/src/Poche/Util/Token.php +++ b/src/Poche/Util/Token.php @@ -15,7 +15,7 @@ class Token return substr(base64_encode(file_get_contents('/dev/urandom', false, null, 0, 20)), 0, 15); } else { - return substr(base64_encode(uniqid(mt_rand(), true)), 0, 20); + return substr(base64_encode(uniqid(mt_rand(), true)), 0, 15); } } diff --git a/tests/units/Token.php b/tests/units/Token.php new file mode 100644 index 0000000..630852e --- /dev/null +++ b/tests/units/Token.php @@ -0,0 +1,17 @@ +integer(strlen(\Poche\Util\Token::generateToken())) + ->isEqualTo(15) + ; + } +} +