/** * Test generating random number with php openssl extension algorithm. * * @author Benjamin Carl <*****@*****.**> */ public function testGeneratingRandomIntegerByOpenSsl() { $generator = new Generator(Generator::MODE_OPEN_SSL); $this->assertInternalType('int', $generator->generate()); }
/** * Generates a token based on time and random input (salt). * * @author Benjamin Carl <*****@*****.**> * * @return string Generated token */ public function generateToken() { // Generate token from unique input $generator = new RandomNumberGenerator(); $time = microtime(true); $salt = $generator->generate(); return sha1($time . $salt); }