コード例 #1
0
ファイル: Hash.php プロジェクト: Atomox/benhelmerphotography
 public function __construct($config = array())
 {
     if (isset($config['iterations'])) {
         $iteration_count_log2 = $config['iterations'];
     } else {
         $iteration_count_log2 = 8;
     }
     if (isset($config['portable'])) {
         $portable_hashes = $config['portable'];
     } else {
         $portable_hashes = FALSE;
     }
     self::$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
     if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) {
         $iteration_count_log2 = 8;
     }
     self::$iteration_count_log2 = $iteration_count_log2;
     self::$portable_hashes = $portable_hashes;
     self::$random_state = microtime();
     if (function_exists('getmypid')) {
         self::$random_state .= getmypid();
     }
 }