{"_id":"2fa-util","_rev":"11-f1ba80d0386659018ae5e299ddb8e7e4","name":"2fa-util","dist-tags":{"latest":"1.5.0"},"versions":{"1.0.0":{"name":"2fa-util","version":"1.0.0","keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"author":{"name":"John Ho"},"license":"MIT","_id":"2fa-util@1.0.0","maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"homepage":"https://github.com/jzhobes/2fa-config#readme","bugs":{"url":"https://github.com/jzhobes/2fa-config/issues"},"dist":{"shasum":"633cc475d70320587736b0cc477a2474087ff738","tarball":"https://registry.npmjs.org/2fa-util/-/2fa-util-1.0.0.tgz","fileCount":8,"integrity":"sha512-cw3m8nPYK+MRuxkETtBUc9/sN2GlUrJTOAFTKoQ6+TXJMgxK20rVSeNCxQy8RTaWBdnLZ8sGg8Q2jXGr2Q8big==","signatures":[{"sig":"MEUCIDNLIl+x/jdVEKR1qfeGRxgheBwh+RH1GYGdOyeKDPCQAiEAq9Cma7QehLelp8VH8VYB4bkPxRwIoNmCdnPoTw1ncSo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9597},"main":"index.js","gitHead":"5b0aa994bbf2574793c02423cd5f62e0214c3a1d","private":false,"scripts":{"lint":"eslint *.js --format table","test":"jest"},"_npmUser":{"name":"jzhobes","email":"jzhobes@gmail.com"},"repository":{"url":"git+https://github.com/jzhobes/2fa-config.git","type":"git"},"_npmVersion":"7.21.1","description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","directories":{},"_nodeVersion":"16.9.1","dependencies":{"otplib":"^12.0.1","qrcode":"^1.4.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.2.4","eslint":"^7.32.0","eslint-plugin-jest":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/2fa-util_1.0.0_1633576835042_0.4074034089621903","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"2fa-util","version":"1.0.1","keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"author":{"name":"John Ho"},"license":"MIT","_id":"2fa-util@1.0.1","maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"homepage":"https://github.com/jzhobes/2fa-config#readme","bugs":{"url":"https://github.com/jzhobes/2fa-config/issues"},"dist":{"shasum":"cc48a32406d13ae52b31bcf98645a7d02d433e07","tarball":"https://registry.npmjs.org/2fa-util/-/2fa-util-1.0.1.tgz","fileCount":8,"integrity":"sha512-5VqAG+e7AHibAERjziKfJklZD9AFF7oaz3tvjTXYuZwKhIxTFXwf4zo9YfLaj6IhVxg4pYlrl08zA38MwnfoLw==","signatures":[{"sig":"MEUCIQDfZ6ZWKYEZ/g23n0LuS4JbmmuPMh3F/SFx/lY2gQ/wAAIgP98VDwfQtFv9xYwta5ErGF6sQt58QD/2Dn1BroUoPJs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9595},"main":"index.js","gitHead":"fb720b613badbcb4796b039317414a871685324f","private":false,"scripts":{"lint":"eslint *.js --format table","test":"jest"},"_npmUser":{"name":"jzhobes","email":"jzhobes@gmail.com"},"repository":{"url":"git+https://github.com/jzhobes/2fa-config.git","type":"git"},"_npmVersion":"7.21.1","description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","directories":{},"_nodeVersion":"16.9.1","dependencies":{"otplib":"^12.0.1","qrcode":"^1.4.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.2.4","eslint":"^7.32.0","eslint-plugin-jest":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/2fa-util_1.0.1_1633577275386_0.013900900585844589","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"2fa-util","version":"1.0.2","keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"author":{"name":"John Ho"},"license":"MIT","_id":"2fa-util@1.0.2","maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"homepage":"https://github.com/jzhobes/2fa-config#readme","bugs":{"url":"https://github.com/jzhobes/2fa-config/issues"},"dist":{"shasum":"f78d07acba384d9f8dc11ef62acd9d36481e0072","tarball":"https://registry.npmjs.org/2fa-util/-/2fa-util-1.0.2.tgz","fileCount":8,"integrity":"sha512-XZ1AH9FS3NoZ9rYP1rEw99YT05F5JMW76GlQveBo1P04+hpmCZQd7gGu0UqZAOkJwiShwVjdzOL2q+0ahxvehw==","signatures":[{"sig":"MEYCIQDp0b09oyUmbhTT/7BnIHv5wqjmuOmYiPW0VH/oF9VxRwIhAPwrAsLhQt1CzkDsZbespaxAynGxLH9v7hOIRTYcERpS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9531},"main":"index.js","gitHead":"3b70aa4bf696cf6fc1025a929ffe3642c1c320d0","private":false,"scripts":{"lint":"eslint *.js --format table","test":"jest"},"_npmUser":{"name":"jzhobes","email":"jzhobes@gmail.com"},"repository":{"url":"git+https://github.com/jzhobes/2fa-config.git","type":"git"},"_npmVersion":"7.21.1","description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","directories":{},"_nodeVersion":"16.9.1","dependencies":{"otplib":"^12.0.1","qrcode":"^1.4.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.2.4","eslint":"^7.32.0","eslint-plugin-jest":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/2fa-util_1.0.2_1633579103868_0.1716016152502664","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"2fa-util","version":"1.0.3","keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"author":{"name":"John Ho"},"license":"MIT","_id":"2fa-util@1.0.3","maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"homepage":"https://github.com/jzhobes/2fa-config#readme","bugs":{"url":"https://github.com/jzhobes/2fa-config/issues"},"dist":{"shasum":"1d32a180133e3dfe659d0596e3d8865313feda50","tarball":"https://registry.npmjs.org/2fa-util/-/2fa-util-1.0.3.tgz","fileCount":8,"integrity":"sha512-8mdsPfRJxviRf5g1aceH1key8oDNJdCf2yo2zA4CVFX129desXG+GjC3Xp8f/Vq5tcDTW0sAjiM8pEJWP24zWQ==","signatures":[{"sig":"MEUCIQDHSTCuHFbu0XfFXijWi1/RZka+Cmym3Mc0/bT6KXUE+QIgRgQX8BRHMDhmUK6Q4trcg+TB6R6d5PzdmpxSb+V63sc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9582},"main":"index.js","gitHead":"00641a36f22525c2213656b0cc41a7e14669425d","private":false,"scripts":{"lint":"eslint *.js --format table","test":"jest"},"_npmUser":{"name":"jzhobes","email":"jzhobes@gmail.com"},"repository":{"url":"git+https://github.com/jzhobes/2fa-config.git","type":"git"},"_npmVersion":"7.21.1","description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","directories":{},"resolutions":{"ansi-regex":"^5.0.1"},"_nodeVersion":"16.9.1","dependencies":{"otplib":"^12.0.1","qrcode":"^1.4.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.2.4","eslint":"^7.32.0","eslint-plugin-jest":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/2fa-util_1.0.3_1633972147551_0.5057970222681687","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"2fa-util","version":"1.1.0","keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"author":{"name":"John Ho"},"license":"MIT","_id":"2fa-util@1.1.0","maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"homepage":"https://github.com/jzhobes/2fa-config#readme","bugs":{"url":"https://github.com/jzhobes/2fa-config/issues"},"dist":{"shasum":"dbc2bb73bbeef5c4f02e5944557ba7267272b3c4","tarball":"https://registry.npmjs.org/2fa-util/-/2fa-util-1.1.0.tgz","fileCount":9,"integrity":"sha512-c2jaUIY3zePKowsMiJm4VQCZHSlWR7AJnp2jrSFtkxacMI99wrorr4grKCnn84AMpxolWuxYKYbX9Rt1pqik5Q==","signatures":[{"sig":"MEUCIFGWibPxvEe3oLze8G2WYw9w4Wjw0dSk5zvmEbqzQpXmAiEAkFWPlscVKh5JJ8ijRWLlbOL+fuXPkLromERBXVFL7uM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11087},"main":"index.js","gitHead":"610b8da6333cbbb943627c7b1917de5a76d5d09e","private":false,"scripts":{"lint":"eslint *.js --format table","test":"jest"},"_npmUser":{"name":"jzhobes","email":"jzhobes@gmail.com"},"repository":{"url":"git+https://github.com/jzhobes/2fa-config.git","type":"git"},"_npmVersion":"7.21.1","description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","directories":{},"resolutions":{"ansi-regex":"^5.0.1"},"_nodeVersion":"16.9.1","dependencies":{"otplib":"^12.0.1","qrcode":"^1.4.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.2.4","eslint":"^7.32.0","eslint-plugin-jest":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/2fa-util_1.1.0_1634166413432_0.9017117588192778","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"2fa-util","version":"1.1.1","keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"author":{"name":"John Ho"},"license":"MIT","_id":"2fa-util@1.1.1","maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"homepage":"https://github.com/jzhobes/2fa-config#readme","bugs":{"url":"https://github.com/jzhobes/2fa-config/issues"},"dist":{"shasum":"3c4ba97e85a0247d8057ff147c49fcce0b3e7dbb","tarball":"https://registry.npmjs.org/2fa-util/-/2fa-util-1.1.1.tgz","fileCount":9,"integrity":"sha512-DplBQOPMheQuutnf9friLipU9XKinEFn2wQBB6RT6bnrPbDOhY/wXB4A8kH3yhagb7Z/sqIOrAwuXTeDY0OmIA==","signatures":[{"sig":"MEQCIEgNi1SXjx/Rmhru9SSg//TiM0DpekuNHTw0nut8bNXgAiArmbjyO/uaD6cdI5npKjsuFXFIuL6kNb7YvWrdEpssng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuebaCRA9TVsSAnZWagAA/KgP/1zNZlYqTrqRZeCptNMg\nH/LziGgUXlCLhZdf8m6PuCilgQEwz1qSA2/xY6V+k+hGMGd837X1Gw5rGjDw\nUwM1d9WfjdW+Pj0G5YN8YBooazgvisuGuE9hecWeZa+TooQmciwj6MYQ3c0G\nJ/uQmZ/4C8TSzAi+PlpJRfx3SX/bQVs8uItsdYRdsIpS5NHrLhAA+GtsUnPm\n0b85yfYv8ccCne4LD4n1fs7MNOdLrXVuLYg8rKtKoF01gwmJhBQWzCL0gb98\n1HHtF256hihb4K8/8Rcxr/cDcYJL1U3yRfLtNxOHZrH0Q9pYd+vrVOMMN8/9\nDJ2ep1JOEysk46PiW0O1B1QQKK4yu5COXdn4b51UOzvmu9rUlbk/y3fFHj9i\nXqHo6zqxZYlBNjjgqsQ5ZLtx6oHjCO+XA68dmB/rrD/lklRoXtr2BggW3A6P\nIb6uP8krtd16eghC4IcX3wihns53oetZYS6sVFJNwQ3xHMyDU3XMsE1fN75f\nXW78yPkGX41LADHgBLLBrvdKnwuYWWX1uNA4S0aTdh8/NJXszj81sq81aTBu\nadyvhiw9fN2aPy6BakHu7N4tzFzBb7WpRg9f37AIFdqb4GnweJoI2BvzRS26\nbjgYmonnSZf2RY7NcFBlAwN4dTK4rh7qsaA/SHH9IA3W9As3biWiKZdY2G4M\niaS6\r\n=PX+y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"3de2f362329a68d2c1e13407896f2fab36f192b3","private":false,"scripts":{"lint":"eslint *.js --format stylish","test":"jest"},"_npmUser":{"name":"jzhobes","email":"jzhobes@gmail.com"},"repository":{"url":"git+https://github.com/jzhobes/2fa-config.git","type":"git"},"_npmVersion":"8.1.0","description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","directories":{},"resolutions":{"ansi-regex":"^5.0.1"},"_nodeVersion":"16.12.0","dependencies":{"otplib":"^12.0.1","qrcode":"^1.4.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","eslint":"^8.1.0","eslint-plugin-jest":"^25.2.2"},"_npmOperationalInternal":{"tmp":"tmp/2fa-util_1.1.1_1635793277488_0.10124711952344123","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"2fa-util","version":"1.2.0","keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"author":{"name":"John Ho"},"license":"MIT","_id":"2fa-util@1.2.0","maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"homepage":"https://github.com/jzhobes/2fa-config#readme","bugs":{"url":"https://github.com/jzhobes/2fa-config/issues"},"dist":{"shasum":"262c586a9c103122d83fcb3963f3e8609f6046cf","tarball":"https://registry.npmjs.org/2fa-util/-/2fa-util-1.2.0.tgz","fileCount":10,"integrity":"sha512-R+p2W/0+SmlKc8ltzU9cjoXEaFqtGua0K82zI53wPy2bIl59laguOg7SAW4dN0Ji8Nf3qDy0MIIHGTd4vujF+Q==","signatures":[{"sig":"MEYCIQCfPV6Ay6ZJ97QtnH5xV/j8zbuxIGG+vjhfVn881BHiywIhAOx9UBcHadiHWBnfhMWMZgmFOh8wBdSgHTGJW8W2EuWq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13425},"main":"index.js","gitHead":"cf7d944420a85e7f581ed2294e9ec5ef978dcd62","private":false,"scripts":{"lint":"eslint *.js --format stylish","test":"jest"},"_npmUser":{"name":"jzhobes","email":"jzhobes@gmail.com"},"repository":{"url":"git+https://github.com/jzhobes/2fa-config.git","type":"git"},"_npmVersion":"8.19.3","description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","directories":{},"resolutions":{"ansi-regex":"^5.0.1"},"_nodeVersion":"18.13.0","dependencies":{"otplib":"^12.0.1","qrcode":"^1.4.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","eslint":"^8.1.0","eslint-plugin-jest":"^25.2.2"},"_npmOperationalInternal":{"tmp":"tmp/2fa-util_1.2.0_1684161329788_0.6321826287574084","host":"s3://npm-registry-packages"}},"1.4.0":{"name":"2fa-util","version":"1.4.0","keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"author":{"name":"John Ho"},"license":"MIT","_id":"2fa-util@1.4.0","maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"homepage":"https://github.com/jzhobes/2fa-config#readme","bugs":{"url":"https://github.com/jzhobes/2fa-config/issues"},"dist":{"shasum":"426b9e1c4c329641c885287410b97c862e669276","tarball":"https://registry.npmjs.org/2fa-util/-/2fa-util-1.4.0.tgz","fileCount":10,"integrity":"sha512-MWo+aZR2OfltNl8UpxxnCVWRFRlsF3J7FXpVinhPBI3mT+T2TyKNfrDlK+jzAWbNHRhTZ1iIrPav93F3vAPpNA==","signatures":[{"sig":"MEUCIElVtOgyJuC6DB6KAEG/q0dloo97zsdckYk4vnEHimpgAiEAzHKT20Mbm6ZAK8LPIKeKAr+GtVFuhhdpK9aT41y63VY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11776},"main":"index.js","gitHead":"320c85c4b57e4e30ed1e741e62d70f56d9b4f42b","private":false,"scripts":{"lint":"eslint *.js --format stylish","test":"jest"},"_npmUser":{"name":"jzhobes","email":"jzhobes@gmail.com"},"repository":{"url":"git+https://github.com/jzhobes/2fa-config.git","type":"git"},"_npmVersion":"10.8.1","description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","directories":{},"_nodeVersion":"20.16.0","dependencies":{"otplib":"^12.0.1","qrcode":"^1.5.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.21.0","globals":"^16.0.0","@eslint/js":"^9.21.0","eslint-plugin-jest":"^28.11.0"},"_npmOperationalInternal":{"tmp":"tmp/2fa-util_1.4.0_1741060528211_0.78282446739917","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"2fa-util","version":"1.5.0","description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/jzhobes/2fa-util.git"},"author":{"name":"John Ho"},"license":"MIT","private":false,"keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"dependencies":{"otplib":"^12.0.1","qrcode":"^1.5.4"},"devDependencies":{"@eslint/js":"^9.39.1","eslint":"^9.39.1","eslint-plugin-jest":"^29.2.1","globals":"^16.5.0","jest":"^30.2.0"},"scripts":{"lint":"eslint *.js --format stylish","test":"jest"},"gitHead":"6b9c2d04817b48a7913607af403d3c4ef66597ed","_id":"2fa-util@1.5.0","bugs":{"url":"https://github.com/jzhobes/2fa-util/issues"},"homepage":"https://github.com/jzhobes/2fa-util#readme","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-6PcLiwTCfcfMiUuMY8u7wLgxk1N7XQaPVKLBGUOb/6JXUOfCmA2a7z6+c6w/GEhw5zrSIFcSk3fzSfwUV4aD9w==","shasum":"904b812d3682d437ca14739a9d3b146cf2d9e616","tarball":"https://registry.npmjs.org/2fa-util/-/2fa-util-1.5.0.tgz","fileCount":12,"unpackedSize":760844,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICYbRJQouqIe0QJ54JB9jAo9W9p6cBVA8Mgm1xHK0oXEAiBTnhK0cjEiwTIxjVRlr/HZUFANjff41ZqeZOCFIRUlVA=="}]},"_npmUser":{"name":"jzhobes","email":"jzhobes@gmail.com"},"directories":{},"maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/2fa-util_1.5.0_1764822120308_0.914351744597738"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-07T03:20:35.041Z","modified":"2025-12-04T04:22:00.759Z","1.0.0":"2021-10-07T03:20:35.162Z","1.0.1":"2021-10-07T03:27:55.540Z","1.0.2":"2021-10-07T03:58:23.985Z","1.0.3":"2021-10-11T17:09:07.684Z","1.1.0":"2021-10-13T23:06:53.591Z","1.1.1":"2021-11-01T19:01:17.654Z","1.2.0":"2023-05-15T14:35:29.990Z","1.4.0":"2025-03-04T03:55:28.400Z","1.5.0":"2025-12-04T04:22:00.565Z"},"bugs":{"url":"https://github.com/jzhobes/2fa-util/issues"},"author":{"name":"John Ho"},"license":"MIT","homepage":"https://github.com/jzhobes/2fa-util#readme","keywords":["2fa","2 factor","qr","qr code","qrcode","two-factor","two factor","totp","google authenticator","microsoft authenticator"],"repository":{"type":"git","url":"git+https://github.com/jzhobes/2fa-util.git"},"description":"Lightweight utility to generate a two-factor TOTP secret with QR code to be used by authenticators such as Google or Microsoft Authenticator.","maintainers":[{"name":"jzhobes","email":"jzhobes@gmail.com"}],"readme":"# 2fa-util\n\n![Build Status](https://github.com/jzhobes/2fa-util/actions/workflows/nodejs.yml/badge.svg)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n![NPM Version](https://img.shields.io/npm/v/2fa-util.svg)\n\nA lightweight, robust Node.js utility for generating Two-Factor Authentication (TOTP) secrets, QR codes, and verifying tokens. Compatible with Google Authenticator, Microsoft Authenticator, and Authy.\n\n### [🚀 Live Demo](https://jzhobes.github.io/2fa-util/)\n\n## Features\n\n*   **Easy Setup**: Generate a secret and QR code in one function call.\n*   **Standard Compatible**: Works with any RFC 6238 compliant authenticator app.\n*   **Flexible Verification**: Supports custom windows, steps, and other `otplib` options.\n*   **Zero-Dependency (Runtime)**: Bundles necessary logic efficiently (uses `otplib` and `qrcode` under the hood).\n\n## Installation\n\n```bash\nnpm install 2fa-util\n```\n\n## Usage\n\n### Basic Example\n\n```javascript\nconst { generateSecret, verify } = require('2fa-util');\n\n(async () => {\n    // 1. Generate a Secret and QR Code\n    const { secret, qrcode, otpauth } = await generateSecret('john.doe@example.com', 'MyApp');\n    \n    console.log('Secret:', secret);\n    console.log('QR Code Data URL:', qrcode); // Display this in an <img src=\"...\">\n\n    // ... User scans QR code ...\n\n    // 2. Verify a Token\n    const userToken = '123456'; // Input from user\n    const isValid = verify(userToken, secret);\n\n    console.log('Is Valid:', isValid);\n})();\n```\n\n### Advanced Verification (Custom Options)\n\nYou can pass standard `otplib` options to the `verify` function, such as `window` (for clock drift) or `step`.\n\n```javascript\nconst isValid = verify(token, secret, {\n    window: 1, // Allow 1 step before/after (approx +/- 30sec)\n    step: 60   // Custom step size in seconds\n});\n```\n\n## API Reference\n\n### `generateSecret(label, [issuer])`\n\nGenerates a new TOTP secret and corresponding QR code.\n\n*   **label** `(string)`: The username or account identifier (e.g., email).\n*   **issuer** `(string, optional)`: The name of your application or company.\n*   **Returns**: `Promise<Object>`\n    *   `secret`: The base32 encoded secret key.\n    *   `qrcode`: A Data URI string (base64) of the QR code image.\n    *   `otpauth`: The raw `otpauth://` URL.\n\n### `verify(token, secret, [options])`\n\nVerifies a TOTP token against a secret.\n\n*   **token** `(string)`: The 6-digit token provided by the user.\n*   **secret** `(string)`: The user's stored secret key.\n*   **options** `(Object, optional)`: Configuration object passed to `otplib`.\n*   **Returns**: `boolean` (`true` if valid, `false` otherwise).\n\n### `generate(secret)`\n\nGenerates the current token for a given secret (useful for testing or dev tools).\n\n*   **secret** `(string)`: The secret key.\n*   **Returns**: `string` (The current 6-digit token).\n\n## Development\n\nClone the repository and install dependencies:\n\n```bash\ngit clone https://github.com/jzhobes/2fa-util.git\ncd 2fa-util\nnpm install\n```\n\nRun tests:\n\n```bash\nnpm test\n```\n\nRun linting:\n\n```bash\nnpm run lint\n```\n\n## License\n\nMIT © [John Ho](https://github.com/jzhobes)\n","readmeFilename":"README.md"}