rusotp-0.3.5 has been yanked.
rusotp
OTP generation and validation library.
- Implements RFC4226 and RFC6238
- Supports alphanumeric OTP generation
- Supports
HmacSha1,HmacSha256, andHmacSha512digests
Note: HmacSha1 support is provided for RFC compliance.
It is recommended to use HmacSha256 or HmacSha512 for better security.
installation
Add rusotp to your Cargo.toml:
[]
= "0.3.5"
HOTP Usage
use ;
use NonZeroU8;
const ALGORITHM: Algorithm = SHA1;
const COUNTER: u64 = 1;
TOTP Usage
use ;
use NonZero;
const ALGORITHM: Algorithm = SHA1;
const LENGTH: u8 = 6;
const INTERVAL: u64 = 30;
Documentation
See the docs.rs/rusotp for more examples and API details.
Contributing
We welcome contributions to the rusotp project! Here are some ways you can help:
- Report Bugs: If you find a bug, please report it by opening an issue on GitHub.
- Suggest Features: If you have an idea for a new feature, please open an issue to discuss it.
- Submit Pull Requests: If you want to contribute code, follow these steps:
- Fork the repository (https://github.com/eendroroy/rusotp/fork)
- Create a new branch (
git checkout -b my-new-feature) - Make your changes and commit them (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Open a Pull Request
Please make sure your contributions adhere to our Code of Conduct.
License
This project is licensed under the GNU AGPL-3.0 License. See the LICENSE file for more details.