{"id":23763722,"url":"https://github.com/stevent-team/totp","last_synced_at":"2025-09-05T08:33:04.510Z","repository":{"id":65453592,"uuid":"592183354","full_name":"stevent-team/totp","owner":"stevent-team","description":"Lightweight RFC-compliant TOTP authentication library based on crypto","archived":false,"fork":false,"pushed_at":"2023-01-24T08:14:56.000Z","size":100,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-23T06:41:48.429Z","etag":null,"topics":["2fa","authentication","nodejs","totp","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/stevent-team.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-23T06:07:53.000Z","updated_at":"2023-01-31T23:53:50.000Z","dependencies_parsed_at":"2023-02-13T19:02:24.424Z","dependency_job_id":null,"html_url":"https://github.com/stevent-team/totp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevent-team%2Ftotp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevent-team%2Ftotp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevent-team%2Ftotp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevent-team%2Ftotp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevent-team","download_url":"https://codeload.github.com/stevent-team/totp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232032119,"owners_count":18462972,"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","authentication","nodejs","totp","typescript"],"created_at":"2024-12-31T22:13:22.402Z","updated_at":"2024-12-31T22:13:22.773Z","avatar_url":"https://github.com/stevent-team.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔑 totp\nLightweight rfc-compliant TOTP authentication library for nodejs based on `crypto`\n\n[![npm version](https://img.shields.io/npm/v/@stevent-team/totp)](https://www.npmjs.com/package/@stevent-team/totp)\n[![minzip size](https://img.shields.io/bundlephobia/minzip/@stevent-team/totp)](https://bundlephobia.com/package/@stevent-team/totp)\n\n\u003e **Warning**\n\u003e This package is unstable and still in active development. You are more than welcome to contribute and make use of it but please note that there may be breaking changes\n\nConforms to the [IETF RFC 6238 specification](https://www.rfc-editor.org/rfc/rfc6238) including all interoperability test vectors.\n\n## Installation\n\n```bash\nyarn add @stevent-team/totp\n```\n\n## Examples\n\n```ts\nimport { generateTotp, validateTotp, type TotpOptions } from '@stevent-team/totp'\n\n// Configure\nconst config: TotpOptions = {\n  secret: process.env['MY_SECRET_KEY'], // REQUIRED\n  timestamp: Date.now(),\n  period: 30, // seconds\n  periodOffset: 0,\n  algorithm: 'sha512',\n  outputDigits: 6,\n}\n\n// Generate a one time password (on a client)\nconst pass = generateTotp(config)\nconsole.log(pass) // 568231\n\n// Validate the one time password (on a server)\nconst isValid = validateTotp(pass, config)\nconsole.log(isValid) // true\n```\n\n## Contributing\n\nIssue and PR contributions are greatly welcomed and appreciated!\n\n## License\n\n`totp` is licensed under MIT\n\n*Created with love by the [Stevent Team](https://stevent.club)* 💙\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevent-team%2Ftotp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevent-team%2Ftotp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevent-team%2Ftotp/lists"}