{"id":38258437,"url":"https://github.com/weavc/weav-totp","last_synced_at":"2026-01-17T01:33:36.482Z","repository":{"id":33783710,"uuid":"162038003","full_name":"weavc/weav-totp","owner":"weavc","description":"A javascript implementation of the TOTP algorithm, used in applications like Google Authenticator","archived":false,"fork":false,"pushed_at":"2022-02-11T00:31:54.000Z","size":37,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-03T22:23:38.049Z","etag":null,"topics":["2fa","javascript","npm","security","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/weavc.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}},"created_at":"2018-12-16T20:25:27.000Z","updated_at":"2022-12-25T11:37:05.000Z","dependencies_parsed_at":"2022-08-07T23:01:02.201Z","dependency_job_id":null,"html_url":"https://github.com/weavc/weav-totp","commit_stats":null,"previous_names":["weavc/weav-totp","chrisweaver1/weav-totp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/weavc/weav-totp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavc%2Fweav-totp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavc%2Fweav-totp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavc%2Fweav-totp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavc%2Fweav-totp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weavc","download_url":"https://codeload.github.com/weavc/weav-totp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavc%2Fweav-totp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28491601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","javascript","npm","security","totp","typescript"],"created_at":"2026-01-17T01:33:36.418Z","updated_at":"2026-01-17T01:33:36.474Z","avatar_url":"https://github.com/weavc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## weav-totp\r\n\r\n[![NPM](https://nodei.co/npm/weav-totp.png)](https://nodei.co/npm/weav-totp/)\r\n\r\n### Description\r\n\r\n- Verify 6-digit time-based one time password authentication, as used in applications like google authenticator.\r\n- Create Base32 secrets used by google authenticator to generated the 6 digit OTP.\r\n- Get link to Charted QRCode from google charts. Can be used in webpages etc for applications like google auth.\r\n\r\n### Usage\r\nInstall in your project:\r\n```\r\nnpm i weav-totp\r\n```\r\n\r\nCreating secrets:\r\n```\r\nimport { TOTP } from 'weav-totp';\r\n\r\nTOTP.create('\u003cunique string to user\u003e', '\u003cunique string to you\u003e')\r\n    .then((secret) =\u003e {\r\n        // do stuff with secret\r\n    }, (err) =\u003e { })\r\n```\r\n\r\nVerifying 6-digit OTP:\r\n```\r\nimport { TOTP } from 'weav-totp';\r\n\r\nTOTP.verify('\u003cuser secret\u003e', OTP)\r\n    .then((success) =\u003e {\r\n        // verification successful\r\n    }, (fail) =\u003e { \r\n        // verification failed\r\n    })\r\n```\r\n\r\nGet QRCode link:\r\n```\r\nimport { TOTP } from 'weav-totp';\r\n\r\nvar qrcode = TOTP.chart('\u003cuser secret\u003e', '\u003cusername/email\u003e', '\u003cissuer\u003e');\r\n\r\nthen\r\n\u003cimg src={{ qrcode }}/\u003e\r\n```\r\n\r\n### Disclaimer\r\n\r\nThis has not yet been fully tested. I have been getting the correct results everytime I have personally tested it though. You can use it, but do so with this caution in mind.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweavc%2Fweav-totp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweavc%2Fweav-totp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweavc%2Fweav-totp/lists"}