# Module: stringGeneration

Contains all business rules for randomly generating strings of all kinds.

Author:
  - Seth Hollingsead
Copyright:
  - Copyright © 2022-… by Seth Hollingsead. All rights reserved
Source:
  - businessRules/rules/stringGeneration.js, line 1

### Requires

- module:ruleParsing
- module:loggers
- @haystacks/constants
- path

### Methods

#### (inner) generateInvalidEmail(inputData, inputMetaData) → {string}

Generate an invalid random email address composed of a random selection of mixed case english letters, numeric characters adn optionally special characters from an optional list of allowable special characters, should be generated; generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that contains the number of characters to generate.
`inputMetaData` | array.<boolean, string, string> | An array map with multiple input parameters: inputMetaData[0] = generateSpecialCharacters - A boolean value to indicate if special characters should be included when randomly generating characters for the output string. inputMetaData[1] = allowableSpecialCharacters - The list of allowable special characters as a string, only used if the {@code generateSpecialCharacters} boolean value is set to {@code TRUE}. inputMetaData[2] = specifiedSuffixAndDomain - The specified suffix and domain to use after the "@" symbol in the email being generated, example "Yahoo.com".

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 492

##### Returns:

A string of randomly generated mixed case alpha numeric characters and optionally special characters where the length of the string is also defined as one of the input parameters, formatted as an email: "a@b.com".

Type
  string

#### (inner) generateInvalidEmailWithSpecificSuffixAndDomainName(numberOfCharactersToGenerate, generateSpecialCharacters, allowableSpecialCharacters, specifiedSuffixAndDomain) → {string}

Generate an invalid email composed of a random selection of mixed case english letters, numeric characters and optional special characters from an optional list of allowable special characters, should be generated; generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`numberOfCharactersToGenerate` | integer | The number of characters to generate as an integer.
`generateSpecialCharacters` | boolean | A boolean value to indicate if special characters should be included when randomly generating characters fro the output string.
`allowableSpecialCharacters` | string | The list of allowable special characters as a string, only used if the {@code generateSpecialCharacters} boolean value is set to {@code TRUE}.
`specifiedSuffixAndDomain` | string | The specified suffix and domain to use after the "@" symbol n the email being generated, example: "Yahoo.com".

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 706

##### Returns:

A string of randomly generated mixed case alpha numeric characters and optionally special characters where the length of the string is also defined as one of the input parameters, formatted as an email "a@b.com".

Type
  string

#### (inner) generateRandomBrightColor(inputData, inputMetaData) → {array.<integer, integer, integer>}

Generates a random set of RGB values in the bright color spectrum range. Originally I thought to generate just a bright color, but dividing the spectrum straight in half resulted in mostly drab colors. So I adjusted this function to use the inputs to provide a narrow range of bright values that can be generated. This makes the function nearly identical to the same function that generates random dark colors. Really the only difference is the default values. So this function is refactored to call a generic random color generator business rule.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | integer | The number in either numeric or string format that represents the minimum range that should be used to generate the random color.
`inputMetaData` | string | integer | The number in either numeric or string format that represents the maximum range that should be used to generate the random color.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 1121

##### Returns:

An array of RGB values in the bright color spectrum range.

Type
  array.<integer, integer, integer>

#### (inner) generateRandomColor(inputData, inputMetaData) → {array.<integer, integer, integer>}

Generates a random set of RGB values in the given color range.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | integer | The number in either numeric or string format that represents the minimum range that should be used to generate the random color.
`inputMetaData` | string | integer | The number in either numeric or string format that represents the maximum range that should be used to generate the random coor.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 1189

##### Returns:

An array of RGB values that will be used for a color value.

Type
  array.<integer, integer, integer>

#### (inner) generateRandomDarkColor(inputData, inputMetaData) → {array.<integer, integer, integer>}

Generates a random set of RGB values in the dark color spectrum range. Originally I thought to generate just a dark color, but dividing the spectrum straight in half resulted in mostly drab colors. So I adjusted this function to use the inputs to provide a narrow range of dark values that can be generated. This makes the function nearly identical to the same function that generates random bright colors. Really the only difference is the default values. So this function is refactored to call a generic random color generator business rule.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | integer | The number in either numeric or string format that represents the minimum range that should be used to generate the random color.
`inputMetaData` | string | integer | The number in either numeric or string format that represents the maximum range that should be used to generate the random color.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 1155

##### Returns:

An array of RGB values in the dark color spectrum range.

Type
  array.<integer, integer, integer>

#### (inner) generateRandomInvalidEmail(numberOfCharactersToGenerate, generateSpecialCharacters, allowableSpecialCharacters) → {string}

Generate an invalid email composed of a random selection of mixed case english letters, numeric characters and optional special characters from an optional list of allowable special characters, should be generated; generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`numberOfCharactersToGenerate` | integer | The number of characters to generate as an integer.
`generateSpecialCharacters` | boolean | A boolean value to indicate if special characters should be included when randomly generating characters for the output string.
`allowableSpecialCharacters` | string | The ist of allowable special characters as a string, only used if the {@code generateSpecialCharacters} boolean value is set to {@code TRUE}.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 812

##### Returns:

A string of randomly generated mixed case alpha numeric characters and optionally special characters where the length of the string is also defined as one of the input parameters, formatted as an email "a@b.com".

Type
  string

#### (inner) generateRandomLowerCaseAlphaNumericCodeByLength(inputData, inputMetaData) → {string}

Generate the specified number of random lower case english letters and/or numeric characters and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated lower case letters and/or numbers that should be generated.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 258

##### Returns:

A string of randomly generated lower case english letters and numbers where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomLowerCaseAlphaNumericCodeWithSpecialCharactersByLength(inputData, inputMetaData) → {string}

Generate a random selection of lower case english letters, numeric characters and special characters from a list of allowable special characters, should be generated; generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated lower case english letters, numeric characters adn special characters that should be generated.
`inputMetaData` | string | The list of special characters that should be used during the generation process.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 374

##### Returns:

A string of randomly generated lower case alpha numeric characters, and special characters where the length of the string is defined as one of the input parameters.

Type
  string

#### (inner) generateRandomLowerCaseTextByLength(inputData, inputMetaData) → {string}

Parse the input string, and determine how many lower case english alphabetic characters should be generated, generate them and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that contains a number for how many randomly generated lower case english alphabetic characters that should be generated.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 85

##### Returns:

A string of randomly generated lower case letters where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomLowerCaseTextWithSpecialCharactersByLength(inputData, inputMetaData) → {string}

Generate the specified number of random lower case english letters and/or special characters and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated lower case letters and/or special characters to generate.
`inputMetaData` | string | The list of special characters that should be used during the generation process.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 170

##### Returns:

A string of randomly generated lower case english letters and special characters where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomMixedCaseAlphaNumericCodeByLength(inputData, inputMetaData) → {string}

Generate the specified number of random mixed case english letters and/or numeric characters and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated mixed case letters and/or numbers that should be generated.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 200

##### Returns:

A string of randomly generated mixed case english letters and numbers where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomMixedCaseAlphaNumericCodeWithSpecialCharactersByLength(inputData, inputMetaData) → {string}

Generate a random selection of mixed case english letters, numeric characters and special characters from a list of allowable special characters, should be generated; generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated english letters, numeric characters and special characters that should be generated.
`inputMetaData` | string | The list of special characters that should be used during the generation process.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 314

##### Returns:

A string of randomly generated mixed case alpha numeric characters, and special characters where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomMixedCaseTextByLength(inputData, inputMetaData) → {string}

Parse the input string, and determine how many mixed case english alphabetic characters should be generated, generate them and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that contains a number or how many randomly generated mixed case alphabetic characters should be generated.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 26

##### Returns:

A string of randomly generated mixed case letters where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomMixedCaseTextWithSpecialCharactersByLength(inputData, inputMetaData) → {string}

Generate teh specified number of random mixed case letters and/or special characters and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated mixed case letters and/or special characters to generate the output string.
`inputMetaData` | string | The ist of special characters that should be used during the generation process.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 114

##### Returns:

A string of randomly generated mixed case letters and special characters where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomNumericCodeByLength(inputData, inputMetaData) → {string}

Generate the specified number of random numeric characters and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated numeric characters that should be generated.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 287

##### Returns:

A string of randomly generated numeric characters where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomSpecialCharacterCodeByLength(inputData, inputMetaData) → {string}

Generate a random selection of characters from the input allowable alphabet of characters, generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated special characters that should be generated.
`inputMetaData` | string | The ist of special characters that should be used during the generation process.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 404

##### Returns:

A string of randomly generated characters from the list of allowable special characters that are passed in where the length of the string is defined as one of the input parameters.

Type
  string

#### (inner) generateRandomUpperCaseAlphaNumericCodeByLength(inputData, inputMetaData) → {string}

Generate the specified number of random upper case english letters and/or numeric characters and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that contains a number for how many randomly generated upper case english letters and/or numbers that should be generated.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 229

##### Returns:

A string of randomly generated upper case english letters and numbers where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomUpperCaseAlphaNumericCodeWithSpecialCharactersByLength(inputData, inputMetaData) → {string}

Generate a random selection of upper case english letters, numeric characters and special characters from a list of allowable special characters, should be generated; generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated upper case english letters, numeric characters and special characters that should be generated.
`inputMetaData` | string | Teh list of special characters that should be used during the generation process.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 344

##### Returns:

A string of randomly generated upper case alpha numeric characters, and special characters where the length of the string is defined as one of the input parameters.

Type
  string

#### (inner) generateRandomUpperCaseTextByLength(inputData, inputMetaData) → {string}

Parse the input string, and determine how many upper case english alphabetic characters should be generated, generate them and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that contains a number for how many randomly generated upper case english alphabetic characters should be generated.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 56

##### Returns:

A string of randomly generated upper case letters where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomUpperCaseTextWithSpecialCharactersByLength(inputData, inputMetaData) → {string}

Generate the specified number of random upper cae letters and/or special characters and string them together.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The number of randomly generated upper case english letters and/or special characters to generate.
`inputMetaData` | string | The list of special characters that should be used during the generate process.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 143

##### Returns:

A string of randomly generated upper case english letters and special characters where the length of the string is defined by the input parameter.

Type
  string

#### (inner) generateRandomValidEmail(numberOfCharactersToGenerate, generateSpecialCharacters, allowableSpecialCharacters) → {string}

Generate a valid email composed of a random selection of mixed case english letters, numeric characters and optional special characters from an optional list of allowable special characters, should be generated; generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`numberOfCharactersToGenerate` | integer | Teh number of characters to generate as an integer.
`generateSpecialCharacters` | boolean | A boolean value to indicate if special characters should be included when randomly generating characters for the output string.
`allowableSpecialCharacters` | string | The list of allowable special characters as a string, only used if the {@code generateSpecialCharacters} boolean value is set to {@code TRUE}.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 603

##### Returns:

A string of randomly generated mixed case alpha numeric characters adn optionally special characters where the length of the string is also defined as one of the input parameters, formatted as an email "a@b.com".

Type
  string

#### (inner) generateValidEmail(inputData, inputMetaData) → {string}

Generate a valid random email address composed of a random selection of mixed case english letters, numeric characters and optionally special characters from an optional list of allowable special characters, should be generated; generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that contains the number of characters to generate.
`inputMetaData` | array.<boolean, string, string> | An array map with multiple input parameters. inputMetaData[0] = generateSpecialCharacters - A boolean value to indicate if special characters should be included when randomly generating characters for the output string. inputMetaData[1] = allowableSpecialCharacters - The list of allowable special characters as a string, only used if the {@code generateSpecialCharacters} boolean value is set to {@code TRUE}. inputMetaData[2] = specifiedSuffixAndDomain - The specified suffix and domain to use after the "@" symbol in the email being generated, example "Yahoo.com".

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 432

##### Returns:

A string of randomly generated mixed case alpha numeric characters and optionally special characters where the length of the string is also defined as one of the input parameters, formatted as an email: a@b.com".

Type
  string

#### (inner) generateValidEmailWithSpecificSuffixAndDomainName(numberOfCharactersToGenerate, generateSpecialCharacters, allowableSpecialCharacters, specifiedSuffixAndDomain) → {string}

Generate a valid email composed of a random selection of mixed case english letters, numeric characters and optionally special characters from an optional list of allowable special characters, should be generated; generate them and string them together to the specified length.

##### Parameters:

Name | Type | Description
--- | --- | ---
`numberOfCharactersToGenerate` | integer | The number of characters to generate as an integer.
`generateSpecialCharacters` | boolean | A boolean value to indicate if special characters should be included when randomly generating characters for the output string.
`allowableSpecialCharacters` | string | The list of allowable special characters as a string, only sued if the {@code generateSpecialCharacters} boolean value is set to {@code TRUE}.
`specifiedSuffixAndDomain` | string | The specified suffix and domain to use after the "@" symbol in the email being generated, example: "Yahoo.com".

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringGeneration.js, line 552

##### Returns:

A string of randomly generated mixed case alpha numeric characters and optionally special characters where the length of the string is also defined as one of the input parameters, formatted as an email: "a@b.com".

Type
  string