Skip to content

Instantly share code, notes, and snippets.

@ezimuel
Created January 18, 2013 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezimuel/4566485 to your computer and use it in GitHub Desktop.
Save ezimuel/4566485 to your computer and use it in GitHub Desktop.
Usage of Zend\Crypt\Password\Apache
use Zend\Crypt\Password\Apache;
$apache = new Apache();
$apache->setFormat('crypt');
printf ("CRYPT output: %s\n", $apache->create('password'));
$apache->setFormat('sha1');
printf ("SHA1 output: %s\n", $apache->create('password'));
$apache->setFormat('md5');
printf ("MD5 output: %s\n", $apache->create('password'));
$apache->setFormat('digest');
$apache->setUserName('enrico');
$apache->setAuthName('test');
printf ("Digest output: %s\n", $apache->create('password'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment