{"id":13806160,"url":"https://github.com/OdaiGH/votp","last_synced_at":"2025-05-13T21:32:26.669Z","repository":{"id":207352761,"uuid":"719036729","full_name":"OdaiGH/votp","owner":"OdaiGH","description":"otp module for v, written in v","archived":false,"fork":false,"pushed_at":"2023-11-16T15:03:46.000Z","size":14,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-18T22:31:27.022Z","etag":null,"topics":["2fa","hmac","hotp","module","totp","v","vlang","vlang-library","vlang-module","vlang-package"],"latest_commit_sha":null,"homepage":"","language":"V","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/OdaiGH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-15T10:12:02.000Z","updated_at":"2024-11-07T15:06:01.000Z","dependencies_parsed_at":"2023-11-16T16:37:23.961Z","dependency_job_id":null,"html_url":"https://github.com/OdaiGH/votp","commit_stats":null,"previous_names":["odaigh/totp","odaigh/votp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OdaiGH%2Fvotp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OdaiGH%2Fvotp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OdaiGH%2Fvotp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OdaiGH%2Fvotp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OdaiGH","download_url":"https://codeload.github.com/OdaiGH/votp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254031307,"owners_count":22002742,"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","hmac","hotp","module","totp","v","vlang","vlang-library","vlang-module","vlang-package"],"created_at":"2024-08-04T01:01:08.411Z","updated_at":"2025-05-13T21:32:26.373Z","avatar_url":"https://github.com/OdaiGH.png","language":"V","funding_links":[],"categories":["Libraries"],"sub_categories":["Utility"],"readme":"# V OTP 0.1\n\nvotp enables you to add TOTP or HOTP functionaltiies in your code [the V programming language](https://vlang.io).\n\n[![Twitter URL](https://img.shields.io/twitter/url.svg?label=Follow%20odai_alghamdi\u0026style=social\u0026url=https%3A%2F%2Ftwitter.com%2Fodai_alghamdi)](https://twitter.com/odai_alghamdi)\n\n## Installation\n\n```\nv up\nv install OdaiGH.votp\n```\n\n## Usage\nTime-based one-time password is as follows\n\n```v ignore\n\u003e\u003e\u003e import odaigh.votp\n\u003e\u003e\u003e totp := new_totp(\"YOUR_SECRET\", 6, \"TYPE_OF_DIGEST\", INTERVAL_IN_SECONDS) // DIGESTS SUPPORT are {sha1,sha256,sha512}\n\u003e\u003e\u003e totp := new_totp(\"odai alghamdi\", 6, \"sha512\", 30)\n\u003e\u003e\u003e generated_otp := totp.generate_totp()\n214205\n\u003e\u003e\u003e verify_otp := totp.verify(214205) //verify if given otp at the current time is correct\ntrue\n\u003e\u003e\u003e verify_otp := totp.verify(123456)\nfalse\n```\n\nHMAC-based one-time password is as follows\n\n```v ignore\n\u003e\u003e\u003e import odaigh.votp\n\u003e\u003e\u003e totp := new_hotp(\"YOUR_SECRET\", 6, \"TYPE_OF_DIGEST\") // DIGESTS SUPPORT are {sha1,sha256,sha512}\n\u003e\u003e\u003e totp := new_hotp(\"base32secret3232\", 6, \"sha512\")\n\u003e\u003e\u003e generated_otp := hotp.generate_hotp(COUNTER) // COUNTER for your hmac otp\n\u003e\u003e\u003e generated_otp := hotp.generate_hotp(0) // COUNTER for your hmac otp\n492039\n\u003e\u003e\u003e verify_otp := hotp.verify(492039,0) //verify if given otp at the current counter is correct\ntrue\n\u003e\u003e\u003e verify_otp := hotp.verify(492039,1)\nfalse\n```\n### License\nV otp is licensed under MIT.\n\n### Contributing\nFollow the instructions in [CONTRIBUTING.md](https://github.com/OdaiGH/votp/blob/master/CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOdaiGH%2Fvotp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOdaiGH%2Fvotp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOdaiGH%2Fvotp/lists"}