lib/escort.js
function (value, length) {
            value = String(value);
            var numMissing = length - value.length;
            var prefix = "";
            while (numMissing > 0) {
                prefix += "0";
                numMissing -= 1;
            }
            return prefix + value;
        }
function (value, length) {
            value = String(value);
            var numMissing = length - value.length;
            var prefix = "";
            while (numMissing > 0) {
                prefix += "0";
                numMissing -= 1;
            }
            return prefix + value;
        }
function ( value , length ) { value = String ( value ) ; var numMissing = length - value . length ; var prefix = "" ; while ( numMissing > 0 ) { prefix += "0" ; numMissing -= 1 ; } return prefix + value ; }
Pad a value by prepending zeroes until it reaches a specified length.

@param {String} value the current string or number.
@param {Number} length the size wanted for the value.
@return {String} a string of at least the provided length.
@api private

@example zeroPad(50, 4) == "0050"
@example zeroPad("123", 4) == "0123"
Pad a value by prepending zeroes until it reaches a specified length .