
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@evokegroup/code-generator
Advanced tools
Generates codes
Parameter | Type | Default | Description |
---|---|---|---|
batchCode | number , string | 0 | A batch code or length of a randomly generated batch code |
batchCodeExclude | string[] | [] | An array of batch codes that the random batch code generator should not allow |
chars | string | CodeGenerator.Charset.Microsoft | The set of characters to used to generate codes |
length | number | 8 | The character length of the generated codes |
format | string | null | A custom code format. Specify batch code characters with 'b'. Specify other code character with 'x' |
dups | string[] | [] | Any previously generated codes that should not be duplicated. Codes must match the batchCode, chars, lenth, and format of those to be generated. |
const CodeGenerator = require('@evokegroup/code-generator');
const generator1 = new CodeGenerator();
const generator2 = new CodeGenerator({
chars: CodeGenerator.EChars.AlphaUpper | CodeGenerator.EChars.Numeric | CodeGenerator.EChars.Unambiguous,
length: 8
});
const generator3 = new CodeGenerator({
batchCode: 2,
batchCodeExclude: ['BC', '9T', 'HX'],
chars: CodeGenerator.CharacterSets.Microsoft,
length: 10,
format: 'bbxxx-xxxxx'
});
Array<string>
Parameter | Type | Default | Description |
---|---|---|---|
count | number | 1 | The number of codes to generate |
const CodeGenerator = require('@evokegroup/code-generator');
const generator = new CodeGenerator({
characters: CodeGenerator.EChars.AlphaUpper,
length: 6,
format: 'xx-xx-xx'
});
const codes = generator.generate(10);
The total number of possible codes given the code length, batch code length, and characters.
Property | Value | Description |
---|---|---|
Microsoft | 2346789BCDFGHJKMPQRTVWXY | The characters Microsoft uses in it's product codes |
FAQs
Generates codes
We found that @evokegroup/code-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.