{"id":18310429,"url":"https://github.com/khurozov/totp","last_synced_at":"2025-04-09T11:44:54.748Z","repository":{"id":195494494,"uuid":"692990046","full_name":"khurozov/totp","owner":"khurozov","description":"Java implementation of TOTP","archived":false,"fork":false,"pushed_at":"2024-01-12T16:15:44.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T05:43:59.241Z","etag":null,"topics":["2fa","google-authenticator","java","java-totp","totp","totp-codes","totp-generator","totp-java","totp-library"],"latest_commit_sha":null,"homepage":"","language":"Java","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/khurozov.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":"2023-09-18T06:04:46.000Z","updated_at":"2023-12-18T10:14:11.000Z","dependencies_parsed_at":"2024-01-05T09:27:33.775Z","dependency_job_id":"b43fddea-cff0-453a-8e94-3bb4dd17912a","html_url":"https://github.com/khurozov/totp","commit_stats":null,"previous_names":["khurozov/totp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khurozov%2Ftotp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khurozov%2Ftotp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khurozov%2Ftotp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khurozov%2Ftotp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khurozov","download_url":"https://codeload.github.com/khurozov/totp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248033809,"owners_count":21036864,"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":["2fa","google-authenticator","java","java-totp","totp","totp-codes","totp-generator","totp-java","totp-library"],"created_at":"2024-11-05T16:14:31.783Z","updated_at":"2025-04-09T11:44:54.729Z","avatar_url":"https://github.com/khurozov.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java implementation of TOTP\n\nTOTP (Time-based One-Time Password) algorithm is extension of HOTP (HMAC-based One-Time Password) and additional info can be more about it [here](https://datatracker.ietf.org/doc/html/rfc6238).\n \n## Installation\n\nAdd maven dependency to your project\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003euz.khurozov\u003c/groupId\u003e\n    \u003cartifactId\u003etotp\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Defaults\n\n- Algorithm: SHA1\n- Digits: 6\n- Period: 30 seconds\n\n## Example\n\n```java\nimport uz.khurozov.totp.*;\n\npublic class Demo {\n    public static void main(String[] args) {\n        // previously generated BASE32 secret\n        String secret = \"6GCM7ZFJJGEMHIWZSPQRXV2B66EO7PUS\";\n        System.out.println(\"secret: \" + secret);\n\n        // TOTP instance can be created for a secret once\n        // and generate codes repeatedly\n        TOTP totp = new TOTP(secret);\n        for (int i = 0; i \u003c 10; ++i) {\n            System.out.println(totp.getCode());\n\n            try {\n                Thread.sleep(totp.getPeriod());\n            } catch (InterruptedException e) {\n                throw new RuntimeException(e);\n            }\n        }\n    }\n}\n```\n\n## NOTES\n\nChecked with Google Authenticator app and worked correctly.\n\nFeel free to report about issues or contribute.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhurozov%2Ftotp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhurozov%2Ftotp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhurozov%2Ftotp/lists"}