function generateID( prev ) {
	var cn;
	var i;
	var c;
	var n;
	if ( !prev ) {
		return '000';
	}

	// Iterate from the last character in the identifier:
	n = prev.length;
	for ( i = n-1; i >= 0; i-- ) {
		c = prev.charCodeAt( i );

		// If the last character is a digit between 0 and 8, increment it:
		if ( c >= 48 && c <= 56 ) {
			cn = String.fromCharCode( c+1 );
			return prev.substring( 0, i ) + cn + prev.substring( i+1 );
		}
		// If the last character is equal to 9, set it to 'A':
		if ( c === 57 ) {
			return prev.substring( 0, i ) + 'A' + prev.substring( i+1 );
		}
		// If the last character is a letter between `A` and `Y`, increment it:
		if ( c >= 65 && c <= 89 ) {
			cn = String.fromCharCode( c+1 );
			return prev.substring( 0, i ) + cn + prev.substring( i+1 );
		}
		// If the last character is equal to `Z`, set it to `a`:
		if ( c === 90 ) {
			return prev.substring( 0, i ) + 'a' + prev.substring( i+1 );
		}
		// If the last character is a letter between `a` and `y`, increment it:
		if ( c >= 97 && c <= 121 ) {
			cn = String.fromCharCode( c+1 );
			return prev.substring( 0, i ) + cn + prev.substring( i+1 );
		}
		// If the last character is equal to `z`, set it to `0`:
		if ( c === 122 ) {
			prev = prev.substring( 0, i ) + '0' + prev.substring( i+1 );
		}
	}
}
Returns the next identifier in the sequence of form `[a-zA-Z0-9]{3}` (in lexicographical order).

@private
@param {string} [prev=null] - previous identifier
@returns {string} identifier