{"id":22934646,"url":"https://github.com/frani/totp","last_synced_at":"2025-07-15T23:33:52.592Z","repository":{"id":175109581,"uuid":"653353488","full_name":"frani/totp","owner":"frani","description":"⏰ 🗝️ Time based One Time Password - Zero Dependencies","archived":false,"fork":false,"pushed_at":"2023-10-08T01:03:22.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-08T23:51:38.177Z","etag":null,"topics":["no-dependencies","otp","time-based-one-time-password","time-based-otp","totp","totp-generator","zero-dependencies"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@frani/totp","language":"JavaScript","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/frani.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-06-13T22:38:39.000Z","updated_at":"2023-09-02T20:30:38.000Z","dependencies_parsed_at":"2025-04-01T18:47:00.130Z","dependency_job_id":"bd612838-8e26-46b9-99d7-08610bb4ca5e","html_url":"https://github.com/frani/totp","commit_stats":null,"previous_names":["frani/totp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/frani/totp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frani%2Ftotp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frani%2Ftotp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frani%2Ftotp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frani%2Ftotp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frani","download_url":"https://codeload.github.com/frani/totp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frani%2Ftotp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265467534,"owners_count":23770742,"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":["no-dependencies","otp","time-based-one-time-password","time-based-otp","totp","totp-generator","zero-dependencies"],"created_at":"2024-12-14T11:44:33.188Z","updated_at":"2025-07-15T23:33:52.584Z","avatar_url":"https://github.com/frani.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Time based One Time Password\n\nSimple TOTP, one function to call and generate OTP token.\n\nThis is a no-depenencies package\n\n# Install\n\nif you are using Yarn:\n\n```sh\nyarn add @frani/totp\n```\n\nif you are using NPM:\n\n```sh\nnpm i @frani/totp\n```\n\n# Usage\n\nto generate:\n\n```js\nconst totp = require(\"@frani/totp\");\n\nconst token = totp.generate({\n  secret: \"123\", // optional - default is 'secret'\n  timeStep: 30, // optional - default is 30 seconds\n  digits: 6, // optional - default is 6\n});\nconsole.log(token); // 480143\n```\n\nin case you want to compare, simple regenerate and check with '===', example:\n\n```js\nconst totp = require(\"@frani/totp\");\n\nconst CODE = \"123123\";\n\nconst token = totp.generate({\n  secret: \"123\", // optional - default is 'secret'\n  timeStep: 30, // optional - default is 30 seconds\n  digits: 6, // optional - default is 6\n});\nconsole.log(token); // 480143\n\nif (CODE === token) return true; // is false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrani%2Ftotp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrani%2Ftotp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrani%2Ftotp/lists"}