public static function generatePasswordHash($rawPassword, $cost=11)
    {
        $cost = intval($cost);
        $cost = self::clampValue($cost, $max=31, $min=4);
        
        # has to be 2 digits, eg. 04
        if ($cost < 10)
        {
            $cost = "0" . $cost;
        }
        
        $options = array('cost' => $cost);
        
        $hash = password_hash($rawPassword, PASSWORD_BCRYPT, $options);
        return $hash;
    }