public function setBits($bits = 512)
{
$bits = (int) $bits;
if ($bits != 256 && $bits != 512) {
throw new Exception('Error: The bit setting must be 256 or 512');
}
if ($bits == 256 && CRYPT_SHA256 == 0) {
throw new Exception('Error: SHA 256 hashing is not supported on this system.');
}
if ($bits == 512 && CRYPT_SHA512 == 0) {
throw new Exception('Error: SHA 512 hashing is not supported on this system.');
}
$this->bits = $bits;
return $this;
}