/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014 ForgeRock AS. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/*global exports, openidm */
(function () {
var canBeEncrypted= function (value) {
};
if (!canBeEncrypted(value)) {
return value;
}
};
return value;
}
};
/**
* Produces a random string conforming to a set of minimum complexity requirements and length.
* Useful for setting random passwords.
* @param {Object[]} minimum_requirements - a list of requirements for the random password
* @param {string} minimum_requirements[].rule - the one of UPPERCASE,LOWERCASE,INTEGERS,SPECIAL
* @param {number} minimum_requirements[].minimum - the number of characters required for this rule
* @param {number} total_length - the size of the final random string
* @example
require('crypto').generateRandomString([
{ "rule": "UPPERCASE", "minimum": 1 },
{ "rule": "LOWERCASE", "minimum": 1 },
{ "rule": "INTEGERS", "minimum": 1 },
{ "rule": "SPECIAL", "minimum": 1 }
], 8) // returns a value like "R92kHZ;1"
*/
// returns a random int between the minimum (inclusive) and maximum (exclusive)
}
// returns an index chosen at random from the set of found undefined
// value indexes in the provided array
var i = 0,foundUndefined = [];
for (i=0;i<max;i++) {
foundUndefined.push(i);
}
}
}
var character_buffer = [],
i,j,
// ASCII codes for A-Z: 65-90
},
// ASCII codes for a-z: 97-122
},
},
// ASCII codes for 'special' characters: 58-64
}
}
}
}
// while there aren't any remaining undefined positions, keep filling them in
}
};
}());