VortexOTP
VortexOTP is a simple, flexible, and dependency-light One-Time Password (OTP) generation library for Rust. It allows you to generate OTPs of various lengths and character sets, including numeric, alphanumeric, alphanumeric with special characters, or even your own custom character sets.
Features
- Generate OTPs of a specified length.
- Choose from predefined character sets:
- Numeric
- Alphanumeric (uppercase and lowercase)
- Alphanumeric with common special characters
- Provide a custom character set for OTP generation.
- Minimal dependencies (only
rand). - Clear error handling for invalid inputs (e.g., empty custom character set).
Installation
Add VortexOTP to your Cargo.toml:
[]
= "0.1.4"
Or, if you are using it from a local path or git repository:
Usage
Here's a quick example of how to use VortexOTP:
use ;
Character Sets
OtpCharSet::Numeric:0123456789OtpCharSet::Alphanumeric:0-9,a-z,A-ZOtpCharSet::AlphanumericSpecialChars:0-9,a-z,A-Z,!@#$%^&*()_+-=[]{}|;:,.<>?OtpCharSet::Custom(String): AnyStringyou provide.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue.
License
VortexOTP is licensed under the MIT License. See the LICENSE file (you would need to create this file if you choose MIT and want to include the full license text) in the repository for more details.