FastPass.js is a lightweight JavaScript library that allows you to generate strong and secure random passwords quickly and easily. Whether you need to create a new password for your online accounts or generate multiple passwords for your team, FastPass.js has you covered.
You can install FastPass.js via npm:
npm install fastpass.js
Alternatively, you can include the following script tag in your HTML file to load the library from jsDelivr's CDN:
<script src="https://cdn.jsdelivr.net/npm/fastpass.js/fastpass.min.js"></script>
To generate a random password with FastPass.js, simply call the fastpass.generate() method with your desired options:
var defaultPassword = fastpass.generate();
var customPassword = fastpass.generate({
length: 16,
charsets: ['lowercase', 'uppercase', 'numbers', 'symbols'],
excludeSimilar: true,
excludeAmbiguous: true
});
- length: (optional) The length of the generated password. Default is 12.
- charsets: (optional) An array of character set names to include. Default is ['lowercase', 'uppercase', 'numbers'].
- excludeSimilar: (optional) Exclude characters that can be easily confused, such as i, l, 1, O, 0, etc. Default is false.
- excludeAmbiguous: (optional) Exclude characters that are ambiguous in certain fonts, such as {}, (), [], /, ~, <, >, ;, :, ., ', ", ?. Default is false.
- customCharset: (optional) A custom string representing a character set to use. This allows you to define exactly which characters to include in the generated password.
You can also generate a password using a custom character set:
var customCharsetPassword = fastpass.generate({
customCharset: 'abcXYZ123!@#'
});
Contributions are welcome and greatly appreciated! If you find a bug, have a feature request, or want to contribute code, please open an issue or submit a pull request on Github.
FastPass.js is licensed under the MIT License. Feel free to use, modify, and distribute the library as you see fit.