This package is a library designed to provide out-of-box HOTP and TOTP clients to generate one-time passwords.
cargo add otps
use otps::TotpBuilder;
let mut totp_cleint = TotpBuilder::new()
.base32_secret("GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ")
.build()
.expect("failed to initialize TOTP client");
let totp_code = totp_cleint.generate();
println!("TOTP: {}", totp_code); // 123456
For more examples and detailed usage, refer to the online documentation.
Contributions to this project are welcome and encouraged. If you encounter any bugs or issues, please open an issue on the GitHub repository. If you would like to contribute to the project, please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.