{"id":13408910,"url":"https://github.com/RijulGulati/otpgen","last_synced_at":"2025-03-14T13:32:13.702Z","repository":{"id":48100482,"uuid":"372920171","full_name":"RijulGulati/otpgen","owner":"RijulGulati","description":"Library to generate TOTP/HOTP codes","archived":false,"fork":false,"pushed_at":"2024-01-17T05:55:45.000Z","size":11,"stargazers_count":133,"open_issues_count":1,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-13T20:10:22.610Z","etag":null,"topics":["cli","golang","golang-library","hotp","linux","otpgen","totp"],"latest_commit_sha":null,"homepage":"","language":"Go","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/RijulGulati.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":"2021-06-01T18:02:59.000Z","updated_at":"2024-04-29T11:53:00.537Z","dependencies_parsed_at":"2024-04-29T12:03:05.985Z","dependency_job_id":null,"html_url":"https://github.com/RijulGulati/otpgen","commit_stats":null,"previous_names":["grijul/otpgen"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RijulGulati%2Fotpgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RijulGulati%2Fotpgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RijulGulati%2Fotpgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RijulGulati%2Fotpgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RijulGulati","download_url":"https://codeload.github.com/RijulGulati/otpgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243584526,"owners_count":20314779,"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":["cli","golang","golang-library","hotp","linux","otpgen","totp"],"created_at":"2024-07-30T20:00:56.434Z","updated_at":"2025-03-14T13:32:13.265Z","avatar_url":"https://github.com/RijulGulati.png","language":"Go","funding_links":[],"categories":["Uncategorized","Authentication and OAuth"],"sub_categories":[],"readme":"# otpgen\nLibrary to generate TOTP/HOTP codes\n\n## Installation\n\n```sh\ngo get -u github.com/grijul/otpgen\n```\n\n## Usage\nHere is a sample demonstration\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/grijul/otpgen\"\n)\n\nfunc main() {\n\n\t// Generate TOTP\n\ttotp := otpgen.TOTP{\n\t\tSecret:    \"testpass\",\n\t\tDigits:    8,        //(optional) (default: 6)\n\t\tAlgorithm: \"SHA256\", //(optional) (default: SHA1)\n\t\tPeriod:    45,       //(optional) (default: 30)\n\t\tUnixTime:  11111111, //(optional) (default: Current Unix Time)\n\t}\n\n\tif otp, err := totp.Generate(); err == nil {\n\t\tfmt.Println(otp)\n\t} else {\n\t\tfmt.Println(err.Error())\n\t}\n\n\t// Generate HOTP\n\thotp := otpgen.HOTP{\n\t\tSecret:  \"testsecret\",\n\t\tCounter: 100, //(default: 0)\n\t\tDigits:  8,   //(optional) (default: 6)\n\t}\n\n\tif otp, err := hotp.Generate(); err == nil {\n\t\tfmt.Println(otp)\n\t} else {\n\t\tfmt.Println(err.Error())\n\t}\n}\n```\n\n# Licence\n[MIT](https://github.com/grijul/otpgen/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRijulGulati%2Fotpgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRijulGulati%2Fotpgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRijulGulati%2Fotpgen/lists"}