/** * Init, detect supported hashing */ public function init() { parent::init(); $this->defaultAlgorithm = "sha1md5"; if (function_exists('hash_algos')) { $algos = hash_algos(); if (in_array('sha512', $algos) && in_array('whirlpool', $algos)) { $this->defaultAlgorithm = 'sha512whirlpool'; } elseif (in_array('sha512', $algos)) { $this->defaultAlgorithm = 'sha512'; } } }