generate-random-chars
v1.0.1
Published
Generate some random strings with ease.
Downloads
4
Readme
Installation
To install the module, run:
npm install generate-random-chars
Usage
Here's an example of how to use the module:
const { CharSet, generateString } = require('generate-random-chars');
const result = generateString(
16,
CharSet.UpperCase | CharSet.Numerical,
'@#' // optional
);
console.log(result); // -> "D04W@GK2P#1IYK#D"
CharSet Options
The CharSet
object provides different character set options:
CharSet.UpperCase
- Uppercase letters (A-Z)CharSet.LowerCase
- Lowercase letters (a-z)CharSet.Numerical
- Numbers (0-9)CharSet.Symbols
- Special symbols (!@#$%^&*()_+~|}{[]:;?><,./-=)
You can combine options using bitwise OR (|
).
License
This project is licensed under the MIT License.
Contact
- sey.ioo @Discord