{"id":15346419,"url":"https://github.com/messense/otpauth-rs","last_synced_at":"2025-02-26T18:12:42.504Z","repository":{"id":32847030,"uuid":"36440626","full_name":"messense/otpauth-rs","owner":"messense","description":"Two-step verification of HOTP/TOTP for Rust.","archived":false,"fork":false,"pushed_at":"2024-08-28T10:51:53.000Z","size":3368,"stargazers_count":36,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-19T17:11:14.720Z","etag":null,"topics":["otpauth","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/otpauth","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/messense.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-28T13:35:37.000Z","updated_at":"2025-02-12T02:06:18.000Z","dependencies_parsed_at":"2024-10-16T00:41:18.261Z","dependency_job_id":null,"html_url":"https://github.com/messense/otpauth-rs","commit_stats":{"total_commits":46,"total_committers":3,"mean_commits":"15.333333333333334","dds":"0.15217391304347827","last_synced_commit":"dd3f79fa631d254f245c59c043fbe48846a0d447"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Fotpauth-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Fotpauth-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Fotpauth-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Fotpauth-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/messense","download_url":"https://codeload.github.com/messense/otpauth-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240907852,"owners_count":19876691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["otpauth","rust"],"created_at":"2024-10-01T11:22:20.604Z","updated_at":"2025-02-26T18:12:42.484Z","avatar_url":"https://github.com/messense.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# otpauth-rs\n\n[![CI](https://github.com/messense/otpauth-rs/actions/workflows/CI.yml/badge.svg)](https://github.com/messense/otpauth-rs/actions/workflows/CI.yml)\n[![Crates.io](https://img.shields.io/crates/v/otpauth.svg)](https://crates.io/crates/otpauth)\n\nTwo-step verification of HOTP/TOTP for Rust.\n\n## Installation\n\nAdd it to your ``Cargo.toml``:\n\n```toml\n[dependencies]\notpauth = \"0.5\"\n```\n\n## Examples\n\n### HOTP example\n\n```rust\nuse otpauth::HOTP;\n\n\nfn main() {\n    let auth = HOTP::new(\"python\");\n    let code = auth.generate(4);\n    assert_eq!(true, auth.verify(code, 0, 100));\n}\n```\n\n### TOTP example\n\n```rust\nuse std::time::{SystemTime, UNIX_EPOCH};\n\nuse otpauth::TOTP;\n\n\nfn main() {\n    let auth = TOTP::new(\"python\");\n    let timestamp1 = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();\n    let code = auth.generate(30, timestamp1);\n    let timestamp2 = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();\n    assert_eq!(true, auth.verify(code, 30, timestamp2));\n}\n```\n\n\n## License\n\nThis work is released under the MIT license. A copy of the license is provided in the [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Fotpauth-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmessense%2Fotpauth-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Fotpauth-rs/lists"}