<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

/**
 * makeEncryptedPassword
 *
 * This function will encrypt password
 * according to our encryption logic
 *
 * @param string $rawPassword Raw Password that needs to be Encoded
 * 
 * @return string Salt Encrypted Password
 */
function makeEncryptedPassword($rawPassword)
{
    $salt = "SomeRandomSalt";
    return md5($salt.$rawPassword.$salt);
}

/**
 * Uncamelize
 *
 * returns uncamelized versions of camel case strings
 * example input: theQuickBrownFox
 * output: The Quick Brown Fox
 *
 * @param string  $camel     Camelized Text
 * @param string  $splitter  character by which final string's words will be seperated
 * @param boolean $lowerCase Indicates if it will return lowerCase or UCFirst
 * 
 * @return	string
 */
function uncamelize($camel, $splitter=" ", $lowerCase = false)
{
    $camel=preg_replace(
        '/(?!^)[[:upper:]][[:lower:]]/', 
        '$0', 
        preg_replace('/(?!^)[[:upper:]]+/', $splitter.'$0', $camel)
    );
    if ($lowerCase) {
        return strtolower($camel);
    } else {
        return ucfirst($camel);
    }
}
