- substr: documentation ( source)
- mt_rand: documentation ( source)
- crypt: documentation ( source)
- sha1: documentation ( source)
- str_replace: documentation ( source)
- base64_encode: documentation ( source)
<?php
$mdp1 = "orpea";
$salt = substr(str_replace('+', '.', base64_encode(sha1(mt_rand(), true))), 0, 22);
echo $hash = crypt($mdp1, '$2a$10$'.$salt);