private function generateSecureKey() { $fs = new Filesystem(); $dir = $this->getKeyDir(); if (!$fs->exists($dir)) { $fs->mkdir($dir, 0700); } $file = $dir . DS . $this->getApiKey() . ".key"; $fs->touch($file); file_put_contents($file, Password::generateHexaRandom(45)); $fs->chmod($file, 0600); }
public function testGenerateHexaRandom() { $length = 8; $password = Password::generateHexaRandom($length); $this->assertEquals($length, strlen($password)); }