- crypt: documentation ( source)
- printf: documentation ( source)
<?php
$password = 'test';
// hash generated with PHP 5.3.7+
$hash = '$2y$14$MTIzNDU2Nzg5MDEyMzQ1NexAbOIUHkG6Ra.TK9QxHOVUhDxOe4dkW';
$result = crypt($password, $hash);
printf("Hash %s (length %d)\n", $result, strlen($result));