
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
@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.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.