/*
 * Lifestyle Webconsulting GmbH
 *
 * LICENSE: This Software is the property of Lifestyle Webconsulting GmbH (Aschaffenburg, Germany)
 * and is private by copyright law - it is NOT Freeware.
 *
 * Any unauthorized use of this software without a valid license
 * is a violation of the license agreement and will be prosecuted by
 * civil and criminal law.
 *
 * @copyright  2018 Lifestyle Webconsulting GmbH
 * @link       http://www.life-style.de
 */

var security = function () {

    /**
     * @param {string} username
     * @return {string}
     */
    function stringNiner(username) {
        var mixedUser = '4';
        for (var i = 0; i < username.length; i++) {
            mixedUser = mixedUser + username.charAt(i) + '2';
        }
        return mixedUser;
    }

    /**
     * A-N-N-A
     * @param {string} username
     * @return {string}
     */
    function stringRewinder(username) {
        var mixedUser = '';
        for (var i = username.length; i >= 0; i--) {
            mixedUser = mixedUser + username.charAt(i);
        }
        return mixedUser;
    }

    return {
        encryptFirstName: stringRewinder,
        encryptLastName: stringNiner
    };

}();

module.exports = security;
