{"versions":{"12.0.0-2":{"name":"@otplib/core","version":"12.0.0-2","main":"./index.js","publishConfig":{"access":"public"},"scripts":{},"keywords":["otplib-core"],"otplib":{},"author":{"name":"MIT"},"license":"Gerald Yeo <contact@fusedthought.com>","homepage":"https://yeojz.github.io/otplib","repository":{"type":"git","url":"https://github.com/yeojz/otplib/tree/master/packages/otplib-core"},"types":"./index.d.ts","description":"> Provides core methods for hotp, totp and authenticator.","_id":"@otplib/core@12.0.0-2","_nodeVersion":"10.14.2","_npmVersion":"lerna/3.19.0/node@v10.14.2+x64 (darwin)","dist":{"integrity":"sha512-NcKK/fVeVFrJiS6KKyK2BUFAvgAU9ggFz1mwE8XbFjFnIkipTjfM6FTSPT24ITV/+6NK2+Mml84fKF5b4ALJwA==","shasum":"7853a1b16efb58f90643f1d20b47077c666fcb4f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-12.0.0-2.tgz","fileCount":9,"unpackedSize":44148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCamcCRA9TVsSAnZWagAAFXoP/iTCskI/PqL9/Gwl7d5b\nBjAX0Hc86JdCvIzUQyljTT9ElPtbGYGF+s0c5/N+YqQBOxq7KatCFkw7X2Wu\nJ2DrDbsoh0DqA9RBUZXBEZ/JnSFYuFyGQc2KVdud0x5WJlomMvKS4aZ1xmyL\nB8hlgCoyincPECUqvxmDcUJXzdAzE2HbpzhdsQYFxeJvNq3flWdhbYHnkO9o\nXWbq+cwvIfvlcW6XjmrnglYzSvvDYsVtUeBqcm2ELUVx6kKdyHkzlPhJ/X3h\n+jLKGq6yHpscf2Or8AzWJPL2TbI24n2cwmWylarLc4H8jG2LPHcAKwOhuGyK\nP1lzzaZ1tx5A+MzdV0MdHwe4gIUc251wFFXId6H/k1LbrZctsmngEY7LLUNy\noaDKWpVdV5a+llxFxD6lHGTAZBiBRkegtziOVHEbxJiY185FNZ5da8CoYX1p\nkkF2ToutPXv1k93IvrHGQg3Qr8ZDJmvjIgAmOXjtXeoimj3AIvnfrQA5MXJg\n/KwQp9jWxFN0dF3YP59tTj+Kv4jKXoKEi9hlbL4MMpJat55KU9SuyQeT/b48\nrpQbzbzgaTbLbcFEyAwcn69bGaUT7Y6Rs+4NqYbQtu2f3OEZ6riW3Z4gXeaT\ntK2FTQNtjZx3Nyc1ecTgS0QgtaotCRlWbNxKi/PS+AsiDPqdPIPinUxbTW1Z\ndq/w\r\n=dRaW\r\n-----END PGP SIGNATURE-----\r\n","size":10816},"maintainers":[{"name":"anonymous","email":"gerald@fusedthought.com"}],"_npmUser":{"name":"anonymous","email":"gerald@fusedthought.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_12.0.0-2_1577691548174_0.16055767677202892"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-20T17:53:34.977Z","contributors":[]},"12.0.0-3":{"name":"@otplib/core","description":"core method for otplib","version":"12.0.0-3","main":"./index.js","publishConfig":{"access":"public"},"scripts":{},"keywords":["otplib-core"],"otplib":{},"author":{"name":"Gerald Yeo","email":"contact@fusedthought.com"},"license":"MIT","homepage":"https://yeojz.otplib.dev","repository":{"type":"git","url":"https://github.com/yeojz/otplib/tree/master/packages/otplib-core"},"types":"./index.d.ts","readmeFilename":"README.md","_id":"@otplib/core@12.0.0-3","_nodeVersion":"10.14.2","_npmVersion":"lerna/3.19.0/node@v10.14.2+x64 (darwin)","dist":{"integrity":"sha512-/CcRbPyMab9MQuKj4p5nLk0DLohQiXkqDuVXcfwIKqUrd7KYmnZDuuqVvfoFK/bXETYbhfkR+UY9h+8XeQFEYw==","shasum":"5be71eb9d375396e71cc3837b35054cfec23be04","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-12.0.0-3.tgz","fileCount":9,"unpackedSize":44185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCa6GCRA9TVsSAnZWagAA0PoQAJwGpYgCEOrEwQaZ1/p6\nmadPgcgkCca0qrdYPFbBMeYX7R5KpRx/FLbgN2qIg/UjLS1VlcwVnWg/lIK2\nWHffm22VrIikc+xZCsEclrjDAXx7SP7CcnRG9rux7SsVuJjdIBCs+OzndXZ0\nh0O6C1Ag2tdVg8ttyhUrQ5sJwq9QqOJFukT+Ah0m5ph9Ie9KWMLn7pojwHue\nn8iFwbTZR8g27VCpAR02RY6Zy47S7aPWhHJxzB9yI1LejgpSjV4WlpEijqAu\nQU2cgUQjdkybuYNB76tp/MkzgWjm7jsq5l1Aa6TqqmVPKqSf6pRuoSorLfM+\nThmrjt7a1FZG7syPznFnlo7qfcnjG8i043IEXP8sbr9PHignDakecWcn0Cuh\nHmk2QAjdw1WMFkeckrAcyHMUQi/3lu8NUVpMZegG95okmz1Lus0yIm3oEPji\nKzEC4SLHi28CEzQLjbwBTiXa8dgX25+YzTtuxb/rUIC7TGqFqCebIeHI5BKt\nxeSiaD6GVuP96fHED0BEFlMvCf5CAdhRqAHrFXlm3Z3iQOVyjNlY+lekII7i\nrviDJfTLas8P8389ovZbK/FT0BZ1jLXACVsyn0Jpj4gj/tr5EhNBljJBJ2ET\ngbbzkVHrd6z8QCctXJzHpY1WtJY/muiw4keqiS2LYIIDoN8ffr8Ekz75AWPo\nSwDh\r\n=NjiX\r\n-----END PGP SIGNATURE-----\r\n","size":10829},"maintainers":[{"name":"anonymous","email":"gerald@fusedthought.com"}],"_npmUser":{"name":"anonymous","email":"gerald@fusedthought.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_12.0.0-3_1577692805879_0.0008230699827183052"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-20T17:53:36.626Z","contributors":[]},"12.0.0":{"name":"@otplib/core","description":"core method for otplib","version":"12.0.0","main":"./index.js","publishConfig":{"access":"public"},"scripts":{},"keywords":["otplib-core"],"otplib":{},"author":{"name":"Gerald Yeo","email":"contact@fusedthought.com"},"license":"MIT","homepage":"https://yeojz.otplib.dev","repository":{"type":"git","url":"https://github.com/yeojz/otplib/tree/master/packages/otplib-core"},"types":"./index.d.ts","_id":"@otplib/core@12.0.0","_nodeVersion":"10.14.2","_npmVersion":"lerna/3.19.0/node@v10.14.2+x64 (darwin)","dist":{"integrity":"sha512-GeIw4fAaiINi4+ssrcBGLebuKzi6I8cMy9cO20YEFjd3CmQU9fz7AF2GIDUwb8zP/vZsooak+cqaxDMcmQ6k3A==","shasum":"880490a26b3fd101fcf0c692f62e2dca2728dc7e","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-12.0.0.tgz","fileCount":9,"unpackedSize":44203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCihQCRA9TVsSAnZWagAAAJMQAJMXh7LptE80yOB/HXAc\nXQIYVApsdMxeTKsA65P2uphPuokY5ioXw8YruIqQMAddlMJvarbB8i8XgYMh\nMhWTrPqzC9UT1liD6AA3xhsVYfZeu/HXL1nxim71tPRTxfD31/hTcjy6bljK\nYJTOGp0w5yLTFgDxKYK+cHJgny3p4Knn9oex/GY7Zwpt/8wb41cuqxotxeb7\ncpkyKiBqoHoz1Rl8I0lfWvTx6aKwzb0w9u9PMspgEiUxknVYDjsp8wYRQu9v\neakEaWYXi3nEunCGcalK9Oy0tG4M8HFdk2wXR5GsHDwWbViGvGvr9h/RQR8g\nq0kXrTgAredkLd+DVix/9cAvvC1N4W3expRu0dfNdEFWNUcO7+USNQVYl17F\n4lXj0txj6zVvnkawTTMq8ZlQFML7lBrgJuFWLFzJ7Hd17L4/E7WYj9Cjg0ax\nSZTP3NRTT5n7ULEusYD3072uXmaS2IO/0z1NIY/wC2ELJkZXT0zyx+IrJKdV\nCxXOIeeckmKELTqMSzMyHbm4H3ilNhaMKgtqMpru56PnlbLde3aomOVFnxCN\nd5yJJz+sDCg0GQ/usRTTPfuzKk7DcAeRF0wvdL7d3yzQKFUBMLDOBcPH+88O\nYA6QN8nwOv9A1yZYv3+uncpoBN5NAuwLa5MEXJ3SYeDqYiddxl2/ciISRrD5\nICRV\r\n=S1SG\r\n-----END PGP SIGNATURE-----\r\n","size":10826},"maintainers":[{"name":"anonymous","email":"gerald@fusedthought.com"}],"_npmUser":{"name":"anonymous","email":"gerald@fusedthought.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_12.0.0_1577723983668_0.22219304600345868"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-20T17:53:38.226Z","contributors":[]},"12.0.1":{"name":"@otplib/core","description":"core method for otplib","version":"12.0.1","main":"./index.js","publishConfig":{"access":"public"},"scripts":{},"keywords":["otplib-core"],"otplib":{},"author":{"name":"Gerald Yeo","email":"contact@fusedthought.com"},"license":"MIT","homepage":"https://yeojz.otplib.dev","repository":{"type":"git","url":"https://github.com/yeojz/otplib/tree/master/packages/otplib-core"},"types":"./index.d.ts","_id":"@otplib/core@12.0.1","_nodeVersion":"10.14.2","_npmVersion":"lerna/3.19.0/node@v10.14.2+x64 (darwin)","dist":{"integrity":"sha512-4sGntwbA/AC+SbPhbsziRiD+jNDdIzsZ3JUyfZwjtKyc/wufl1pnSIaG4Uqx8ymPagujub0o92kgBnB89cuAMA==","shasum":"73720a8cedce211fe5b3f683cd5a9c098eaf0f8d","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-12.0.1.tgz","fileCount":9,"unpackedSize":44203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKybRCRA9TVsSAnZWagAA37EP/j6LZCiVL4W/REKriFp3\n/KIXvLbQU1QeyiVPWnhNbDaLsmkGMOasSc7e5xvRDJogEtIBrlOZZnFSGYgp\n7TMpvekeEbdjZJPpv7/rHhqATK9UfdZAr+ByMd0LUpIcaHJDbi83haVV6HUV\nK+L523OZcd6pn0n9SREIZJ1BzbZ6jxim3QxX2339oIqb3GZgvy+steeqQCOD\nAnhHIsPYubtWnGgNYDDSpbaodVL2IbI7hmyrTFxT2vUqRLTlnpDFP46zDlKV\npS7N8VJWQEv4Z859oOYI7/PR3FAVpJsbIVUHlzHbImmKOxa9jWMG5m7rRxs9\nj11vu/kAZSYJwYAnxSgPIg8SSO3jkdCiX047XuxkvlBqVhtPZVIGntZXWSrh\nqfliSmI/DUUhErSBt5pZ7M/m+imP1iJLm7V8XkgVBFwzNjXmqSWkflW5frcB\nMG/Ccv64K38Ih9CQkcqm22wXWcSTlVnDO9I9ptpAyZblfQzTlqbVyFehpFB6\nZ/vfoabaTjs5DEptT+DDl3aY8ZCpTC1491OhPXSeL4hKi9+dzH8dxQGG2Ifj\nTCbhC5ZeDqhYg65iZ0Josq73LM1zNu1So/NcQ2dmtriAoqLyCCRzlsYC/xnS\npYmC6yCxlBy85lem/W/GD6sps7QNz8KJQ7T37tEtQmApstzNfsRJVxabbffX\nIW4J\r\n=uWiR\r\n-----END PGP SIGNATURE-----\r\n","size":10826},"maintainers":[{"name":"anonymous","email":"gerald@fusedthought.com"}],"_npmUser":{"name":"anonymous","email":"gerald@fusedthought.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_12.0.1_1579886289187_0.42061238218042707"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-20T17:53:38.326Z","contributors":[]},"13.0.0":{"name":"@otplib/core","version":"13.0.0","description":"Core interfaces, types, and crypto abstraction for otplib","license":"MIT","author":{"name":"Gerald Yeo","email":"support@yeojz.dev"},"homepage":"https://otplib.yeojz.dev","repository":{"type":"git","url":"git+https://github.com/yeojz/otplib.git","directory":"packages/core"},"bugs":{"url":"https://github.com/yeojz/otplib/issues"},"keywords":["otp","hotp","totp","2fa","mfa","authenticator","one-time-password"],"sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"devDependencies":{"tsup":"^8.0.1","typescript":"^5.3.3","vitest":"^4.0.16","@repo/testing":"13.0.0"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/","clean":"rm -rf dist .tsbuildinfo"},"_id":"@otplib/core@13.0.0","_integrity":"sha512-1Tak0FJNWKA1LAfXXzZDhhWIjfKJM4fwbtTjEyAlW7/h1yere3WdrrhdUJftcAc6PjcA4XjeRIBvFrLI8ZVZdg==","_resolved":"/tmp/e79f8bd526d677653795f527bfc66311/otplib-core-13.0.0.tgz","_from":"file:otplib-core-13.0.0.tgz","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-1Tak0FJNWKA1LAfXXzZDhhWIjfKJM4fwbtTjEyAlW7/h1yere3WdrrhdUJftcAc6PjcA4XjeRIBvFrLI8ZVZdg==","shasum":"680fb6c29bc1277b5e8c94aeebcb1463b9260f61","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-13.0.0.tgz","fileCount":27,"unpackedSize":357734,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGBmo+KKe48WNkgA/nlnb3KEBpLzEeXWZE3Qi4bF8WWLAiEAr9m4fmWxIeFLxydjN4d8UkAFOPsOZ/pQl2jXn3CkENs="}],"size":72754},"_npmUser":{"name":"anonymous","email":"support@yeojz.dev"},"directories":{},"maintainers":[{"name":"anonymous","email":"support@yeojz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_13.0.0_1768042029312_0.8299206435391189"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-10T10:47:09.479Z","publish_time":1768042029479,"_source_registry_name":"default","contributors":[]},"13.0.1":{"name":"@otplib/core","version":"13.0.1","description":"Core interfaces, types, and crypto abstraction for otplib","license":"MIT","author":{"name":"Gerald Yeo","email":"support@yeojz.dev"},"homepage":"https://otplib.yeojz.dev","repository":{"type":"git","url":"git+https://github.com/yeojz/otplib.git","directory":"packages/core"},"bugs":{"url":"https://github.com/yeojz/otplib/issues"},"keywords":["otp","hotp","totp","2fa","mfa","authenticator","one-time-password"],"sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"devDependencies":{"tsup":"^8.0.1","typescript":"^5.3.3","vitest":"^4.0.16","@repo/testing":"13.0.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/","clean":"rm -rf dist .tsbuildinfo"},"_id":"@otplib/core@13.0.1","_integrity":"sha512-K3E2TKmDs84jhKWQOQc5HXDhOrkdCogQx+8a29Jf9PPxtev9R0MGv8LdlPKHbXzfZmO3wIDjn0wBrBjtzPnG9w==","_resolved":"/tmp/f15b179bfd4066060900fd47aee0c7e4/otplib-core-13.0.1.tgz","_from":"file:otplib-core-13.0.1.tgz","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-K3E2TKmDs84jhKWQOQc5HXDhOrkdCogQx+8a29Jf9PPxtev9R0MGv8LdlPKHbXzfZmO3wIDjn0wBrBjtzPnG9w==","shasum":"7945531f334292e2b572cd967f2070a568102d41","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-13.0.1.tgz","fileCount":27,"unpackedSize":357734,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@otplib%2fcore@13.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDkDLSfZkXx2qAlTRshuWcdXt4wb82rJJ9LPR22R898KAiEA0dHUWLLYcOAPdjps0o2YYZdYFO0ZJL+4abG8L7Nuuw0="}],"size":72751},"_npmUser":{"name":"anonymous","email":"support@yeojz.dev"},"directories":{},"maintainers":[{"name":"anonymous","email":"support@yeojz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_13.0.1_1768062569470_0.09982025333321909"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-10T16:29:29.621Z","publish_time":1768062569621,"_source_registry_name":"default","contributors":[]},"13.0.2":{"name":"@otplib/core","version":"13.0.2","description":"Core interfaces, types, and crypto abstraction for otplib","license":"MIT","author":{"name":"Gerald Yeo","email":"support@yeojz.dev"},"homepage":"https://otplib.yeojz.dev","repository":{"type":"git","url":"git+https://github.com/yeojz/otplib.git","directory":"packages/core"},"bugs":{"url":"https://github.com/yeojz/otplib/issues"},"keywords":["otp","hotp","totp","2fa","mfa","authenticator","one-time-password"],"sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"devDependencies":{"tsup":"^8.0.1","typescript":"^5.3.3","vitest":"^4.0.16","@repo/testing":"13.0.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/","clean":"rm -rf dist .tsbuildinfo"},"_id":"@otplib/core@13.0.2","_integrity":"sha512-cew1CGyLSyO5whNRYWQIXIP0CmR+oA3M2N0uDjVg9Tv1qi19zIePXznVVhxHK/pJ27WjE0zzyQeqdc3zXsxj2Q==","_resolved":"/tmp/2721587cf932081d16f1d391f37304f9/otplib-core-13.0.2.tgz","_from":"file:otplib-core-13.0.2.tgz","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-cew1CGyLSyO5whNRYWQIXIP0CmR+oA3M2N0uDjVg9Tv1qi19zIePXznVVhxHK/pJ27WjE0zzyQeqdc3zXsxj2Q==","shasum":"4939182729ad0ebdf578a978cdc4fb7c56ae8ffe","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-13.0.2.tgz","fileCount":29,"unpackedSize":364935,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@otplib%2fcore@13.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAcUfxwOt38oKMmXw9KLvBvd8ngGYFX+r5ChAIwQm/aaAiAOEXz55vXezqGSr+vG9oxIzmcF8iChbSExB9xQcA2FiA=="}],"size":73615},"_npmUser":{"name":"anonymous","email":"support@yeojz.dev"},"directories":{},"maintainers":[{"name":"anonymous","email":"support@yeojz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_13.0.2_1768120909154_0.6872974520228663"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-11T08:41:49.339Z","publish_time":1768120909339,"_source_registry_name":"default","contributors":[]},"13.1.0":{"name":"@otplib/core","version":"13.1.0","description":"Core interfaces, types, and crypto abstraction for otplib","license":"MIT","author":{"name":"Gerald Yeo","email":"support@yeojz.dev"},"homepage":"https://otplib.yeojz.dev","repository":{"type":"git","url":"git+https://github.com/yeojz/otplib.git","directory":"packages/core"},"bugs":{"url":"https://github.com/yeojz/otplib/issues"},"keywords":["otp","hotp","totp","2fa","mfa","authenticator","one-time-password"],"sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"devDependencies":{"tsup":"^8.0.1","typescript":"^5.3.3","vitest":"^4.0.16","@repo/testing":"13.0.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/","clean":"rm -rf dist .tsbuildinfo"},"_id":"@otplib/core@13.1.0","_integrity":"sha512-bMCuRi5U4m86JnKiijEPTyM1KQlmanlcg/uleTCo4ewtqsYgnIvdNqIOUA6x1cS4X+U9XalmX6zF1N4ddZBdoA==","_resolved":"/tmp/693169bf7acaa24dd588c24fc73943a4/otplib-core-13.1.0.tgz","_from":"file:otplib-core-13.1.0.tgz","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-bMCuRi5U4m86JnKiijEPTyM1KQlmanlcg/uleTCo4ewtqsYgnIvdNqIOUA6x1cS4X+U9XalmX6zF1N4ddZBdoA==","shasum":"d3c5fd9ab50ec71a7b1cee203686b3c6e140fb09","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-13.1.0.tgz","fileCount":29,"unpackedSize":401832,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@otplib%2fcore@13.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCrV1qiiRHtStyEwWhxeU4oXggS9lCfcgAnrOzykJmdhQIhANiMZ3gkmXHaRXFQyLhLDrxrPLOCW+TaeioltYCy+APg"}],"size":83680},"_npmUser":{"name":"anonymous","email":"support@yeojz.dev"},"directories":{},"maintainers":[{"name":"anonymous","email":"support@yeojz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_13.1.0_1768235682735_0.6726191941815607"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-12T16:34:42.889Z","publish_time":1768235682889,"_source_registry_name":"default","contributors":[]},"13.1.1":{"name":"@otplib/core","version":"13.1.1","description":"Core interfaces, types, and crypto abstraction for otplib","license":"MIT","author":{"name":"Gerald Yeo","email":"support@yeojz.dev"},"homepage":"https://otplib.yeojz.dev","repository":{"type":"git","url":"git+https://github.com/yeojz/otplib.git","directory":"packages/core"},"bugs":{"url":"https://github.com/yeojz/otplib/issues"},"keywords":["otp","hotp","totp","2fa","mfa","authenticator","one-time-password"],"sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"devDependencies":{"tsup":"^8.0.1","typescript":"^5.3.3","vitest":"^4.0.16","@repo/testing":"13.0.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/","clean":"rm -rf dist .tsbuildinfo"},"_id":"@otplib/core@13.1.1","_integrity":"sha512-K7167w5T5fBtI7FCTrcTyqHPNEKIvyBHFACvJGXci60V30Rt4VDsRHWw/LYtOZRbUqJbPH9orn4N10dYRVi3bw==","_resolved":"/tmp/67948ef0a64ac55a21dea3a63828e480/otplib-core-13.1.1.tgz","_from":"file:otplib-core-13.1.1.tgz","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-K7167w5T5fBtI7FCTrcTyqHPNEKIvyBHFACvJGXci60V30Rt4VDsRHWw/LYtOZRbUqJbPH9orn4N10dYRVi3bw==","shasum":"7f4a7cdf1bcaa977923fe9ee974d305d93b1b190","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-13.1.1.tgz","fileCount":29,"unpackedSize":401838,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@otplib%2fcore@13.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC9SnceVSmqk4o3Uostth7DrhH250XDSppSWrD2ognyaAIgHOMUF/o+XLQC6dadrEF20Wgnzst8PzCd8RBEjV2Jdlw="}],"size":83676},"_npmUser":{"name":"anonymous","email":"support@yeojz.dev"},"directories":{},"maintainers":[{"name":"anonymous","email":"support@yeojz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_13.1.1_1768406216974_0.9469455481460365"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-14T15:56:57.092Z","publish_time":1768406217092,"_source_registry_name":"default","contributors":[]},"13.2.0":{"name":"@otplib/core","version":"13.2.0","description":"Core interfaces, types, and crypto abstraction for otplib","license":"MIT","author":{"name":"Gerald Yeo","email":"support@yeojz.dev"},"homepage":"https://otplib.yeojz.dev","repository":{"type":"git","url":"git+https://github.com/yeojz/otplib.git","directory":"packages/core"},"bugs":{"url":"https://github.com/yeojz/otplib/issues"},"keywords":["otp","hotp","totp","2fa","mfa","authenticator","one-time-password"],"sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"devDependencies":{"tsup":"^8.0.1","typescript":"^5.3.3","vitest":"^4.0.18","@repo/testing":"13.0.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/","clean":"rm -rf dist .tsbuildinfo"},"_id":"@otplib/core@13.2.0","_integrity":"sha512-A4silkhDfiD63L4uTuJHqeTSTj+ywgusWU8A4h3n/aR2fhq/NU/CtEoqC4QpUz25TO31UGEaPzZicKaGHotzxQ==","_resolved":"/tmp/46a8b8559ad4d52bc3466aa5c6c80fe5/otplib-core-13.2.0.tgz","_from":"file:otplib-core-13.2.0.tgz","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-A4silkhDfiD63L4uTuJHqeTSTj+ywgusWU8A4h3n/aR2fhq/NU/CtEoqC4QpUz25TO31UGEaPzZicKaGHotzxQ==","shasum":"a314fafeaaa4b41fc308f02278ee65b93612f71d","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-13.2.0.tgz","fileCount":29,"unpackedSize":435956,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@otplib%2fcore@13.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCRk0Gzq0uLaqO2GCMyrepq+PzNoqpEGf9Tz4YCNrXjJgIgfXMCBLbIhgXj2Tm+BwuIcligTlsuKfptnyYwX0am4As="}],"size":88703},"_npmUser":{"name":"anonymous","email":"support@yeojz.dev"},"directories":{},"maintainers":[{"name":"anonymous","email":"support@yeojz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_13.2.0_1769355427755_0.12267115736528567"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-25T15:37:07.919Z","publish_time":1769355427919,"_source_registry_name":"default","contributors":[]},"13.2.1":{"name":"@otplib/core","version":"13.2.1","description":"Core interfaces, types, and crypto abstraction for otplib","license":"MIT","author":{"name":"Gerald Yeo","email":"support@yeojz.dev"},"homepage":"https://otplib.yeojz.dev","repository":{"type":"git","url":"git+https://github.com/yeojz/otplib.git","directory":"packages/core"},"bugs":{"url":"https://github.com/yeojz/otplib/issues"},"keywords":["otp","hotp","totp","2fa","mfa","authenticator","one-time-password"],"sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"devDependencies":{"tsup":"^8.0.1","typescript":"^5.3.3","vitest":"^4.0.18","@repo/testing":"13.0.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/","clean":"rm -rf dist .tsbuildinfo"},"_id":"@otplib/core@13.2.1","_integrity":"sha512-IyfHvYNCyipDxhmJdcUUvUeT3Hz84/GgM6G2G6BTEmnAKPzNA7U0kYGkxKZWY9h23W94RJk4qiClJRJN5zKGvg==","_resolved":"/tmp/81228001af467e31a83fd632fa3091c9/otplib-core-13.2.1.tgz","_from":"file:otplib-core-13.2.1.tgz","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-IyfHvYNCyipDxhmJdcUUvUeT3Hz84/GgM6G2G6BTEmnAKPzNA7U0kYGkxKZWY9h23W94RJk4qiClJRJN5zKGvg==","shasum":"83449322a390b6b4c045b2e799cbd1f7718f1f64","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-13.2.1.tgz","fileCount":29,"unpackedSize":435922,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@otplib%2fcore@13.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDcLQxgsFzNQUBer1T0iaNGVJHphlv5633R/0quw0wRcAIgH78ulXYFFMxg/9ZKV5GOp29xqb8UvdoJnUNTb+piNY0="}],"size":88704},"_npmUser":{"name":"anonymous","email":"support@yeojz.dev"},"directories":{},"maintainers":[{"name":"anonymous","email":"support@yeojz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_13.2.1_1769411093355_0.14887528557123564"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-26T07:04:53.487Z","publish_time":1769411093487,"_source_registry_name":"default","contributors":[]},"13.3.0":{"name":"@otplib/core","version":"13.3.0","description":"Core interfaces, types, and crypto abstraction for otplib","license":"MIT","author":{"name":"Gerald Yeo","email":"support@yeojz.dev"},"homepage":"https://otplib.yeojz.dev","repository":{"type":"git","url":"git+https://github.com/yeojz/otplib.git","directory":"packages/core"},"bugs":{"url":"https://github.com/yeojz/otplib/issues"},"keywords":["otp","hotp","totp","2fa","mfa","authenticator","one-time-password"],"sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./errors":{"import":{"types":"./dist/errors.d.ts","default":"./dist/errors.js"},"require":{"types":"./dist/errors.d.cts","default":"./dist/errors.cjs"}},"./utils":{"import":{"types":"./dist/utils.d.ts","default":"./dist/utils.js"},"require":{"types":"./dist/utils.d.cts","default":"./dist/utils.cjs"}},"./types":{"import":{"types":"./dist/types.d.ts","default":"./dist/types.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/types.cjs"}}},"devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","vitest":"^4.0.18","@repo/testing":"13.0.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/","clean":"rm -rf dist .tsbuildinfo"},"_id":"@otplib/core@13.3.0","_integrity":"sha512-pnQDOuCmFVeF/XnboJq9TOJgLoo2idNPJKMymOF8vGqJJ+ReKRYM9bUGjNPRWC0tHjMwu1TXbnzyBp494JgRag==","_resolved":"/tmp/d1e2b1fc0c3c010c0c2a0b814a7d36cb/otplib-core-13.3.0.tgz","_from":"file:otplib-core-13.3.0.tgz","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-pnQDOuCmFVeF/XnboJq9TOJgLoo2idNPJKMymOF8vGqJJ+ReKRYM9bUGjNPRWC0tHjMwu1TXbnzyBp494JgRag==","shasum":"7f037af6cc5907c2cff9cf6092952088a0ce5a6e","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-13.3.0.tgz","fileCount":29,"unpackedSize":470110,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@otplib%2fcore@13.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDu5WCpWRnEorUWvtb8dKjPykTKz97iB59/QoLgKRmfjQIhAMob50Y4S2ihHcmap/I2cxekwu7mBph4pTcGfROsGV7q"}],"size":96444},"_npmUser":{"name":"anonymous","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:84fc447b-2242-4c94-b1f7-b0b7585c55fe"}},"directories":{},"maintainers":[{"name":"anonymous","email":"support@yeojz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_13.3.0_1770906865784_0.3159421205592161"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-12T14:34:25.944Z","publish_time":1770906865944,"_source_registry_name":"default","contributors":[]},"13.4.0":{"name":"@otplib/core","version":"13.4.0","description":"Core interfaces, types, and crypto abstraction for otplib","license":"MIT","author":{"name":"Gerald Yeo","email":"support@yeojz.dev"},"homepage":"https://otplib.yeojz.dev","repository":{"type":"git","url":"git+https://github.com/yeojz/otplib.git","directory":"packages/core"},"bugs":{"url":"https://github.com/yeojz/otplib/issues"},"keywords":["otp","hotp","totp","2fa","mfa","authenticator","one-time-password"],"sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./errors":{"import":{"types":"./dist/errors.d.ts","default":"./dist/errors.js"},"require":{"types":"./dist/errors.d.cts","default":"./dist/errors.cjs"}},"./utils":{"import":{"types":"./dist/utils.d.ts","default":"./dist/utils.js"},"require":{"types":"./dist/utils.d.cts","default":"./dist/utils.cjs"}},"./types":{"import":{"types":"./dist/types.d.ts","default":"./dist/types.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/types.cjs"}}},"devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","vitest":"^4.0.18","@repo/testing":"13.0.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint src/","clean":"rm -rf dist .tsbuildinfo"},"_id":"@otplib/core@13.4.0","_integrity":"sha512-JqOGcvZQi2wIkEQo8f3/iAjstavpXy6gouIDMHygjNuH6Q0FjbHOiXMdcE94RwfgDNMABhzwUmvaPsxvgm9NYw==","_resolved":"/tmp/a9465665e3f9739417edd4b2717d84b0/otplib-core-13.4.0.tgz","_from":"file:otplib-core-13.4.0.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-JqOGcvZQi2wIkEQo8f3/iAjstavpXy6gouIDMHygjNuH6Q0FjbHOiXMdcE94RwfgDNMABhzwUmvaPsxvgm9NYw==","shasum":"14db803de5bd09f7c412eba86c7d193a09d57187","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@otplib/core/-/core-13.4.0.tgz","fileCount":29,"unpackedSize":468812,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@otplib%2fcore@13.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIC0G8+7HknJdbsJJT4E7vWWGGzAIZTTKdZkJY3orrskmAiAe/T8P+bMtzvsv8Bv9PrDNorr3LbwGz8AJOWM5VWrf5Q=="}],"size":96494},"_npmUser":{"name":"anonymous","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:84fc447b-2242-4c94-b1f7-b0b7585c55fe"}},"directories":{},"maintainers":[{"name":"anonymous","email":"support@yeojz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_13.4.0_1773932428658_0.6862939150441243"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-03-19T15:00:28.854Z","publish_time":1773932428854,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"13.4.0","next":"12.0.0-3"},"name":"@otplib/core","time":{"created":"2022-01-26T22:56:19.028Z","modified":"2026-03-19T15:00:42.198Z","12.0.0-2":"2019-12-30T07:39:08.373Z","12.0.0-3":"2019-12-30T08:00:06.031Z","12.0.0":"2019-12-30T16:39:43.790Z","12.0.1":"2020-01-24T17:18:09.352Z","13.0.0":"2026-01-10T10:47:09.479Z","13.0.1":"2026-01-10T16:29:29.621Z","13.0.2":"2026-01-11T08:41:49.339Z","13.1.0":"2026-01-12T16:34:42.889Z","13.1.1":"2026-01-14T15:56:57.092Z","13.2.0":"2026-01-25T15:37:07.919Z","13.2.1":"2026-01-26T07:04:53.487Z","13.3.0":"2026-02-12T14:34:25.944Z","13.4.0":"2026-03-19T15:00:28.854Z"},"readme":"# @otplib/core\n\nCore types, interfaces, and utilities for the otplib OTP library suite.\n\n## Overview\n\n`@otplib/core` provides the foundational abstractions for all otplib packages:\n\n- **Type Definitions** - TypeScript interfaces for OTP operations\n- **Error Classes** - Hierarchical error types for validation and crypto operations\n- **Validation Utilities** - Input validation for secrets, counters, time, and tokens\n- **Crypto Abstraction** - Pluggable crypto backend via `CryptoContext`\n- **Base32 Abstraction** - Pluggable Base32 encoding/decoding via `Base32Context`\n\nThis package is primarily used as a dependency by other otplib packages. Direct usage is only necessary when building custom plugins or extending the library.\n\n> [!IMPORTANT] Breaking Changes (v13)\n> The `totp` and `hotp` specific logic have been moved to their individual packages.\n>\n> See [Getting Started](https://otplib.yeojz.dev/guide/getting-started) for details.\n\n## Installation\n\n```bash\nnpm install @otplib/core\npnpm add @otplib/core\nyarn add @otplib/core\n```\n\n## Usage\n\n`@otplib/core` provides baseline functionality and definitions for the library suite. It defines the errors, input validations and the plugin interfaces.\n\n### Catching specific error types\n\nAll otplib errors extend `OTPError`. Import concrete subclasses to distinguish them in a catch block.\n\n```typescript\nimport { Base32DecodeError, HMACError, SecretTooShortError } from \"@otplib/core\";\n\ntry {\n  const token = await generate({ secret, crypto, base32 });\n} catch (err) {\n  if (err instanceof SecretTooShortError) {\n    // secret is fewer than 16 bytes (128 bits)\n  } else if (err instanceof Base32DecodeError) {\n    // secret string contained invalid Base32 characters\n  } else if (err instanceof HMACError) {\n    // the crypto plugin's HMAC operation failed; err.cause holds the original error\n  }\n}\n```\n\n### Validating inputs\n\nUse the validation utilities before passing values to generation or verification functions.\n\n```typescript\nimport { validateSecret, validateToken, validateCounter } from \"@otplib/core\";\n\n// validateSecret accepts a decoded Uint8Array\nvalidateSecret(decodedSecretBytes); // throws SecretTooShortError / SecretTooLongError\n\n// validateToken checks length and digit-only format\nvalidateToken(token, 6); // throws TokenLengthError or TokenFormatError\n\n// validateCounter checks for negatives, non-integers, and overflow\nvalidateCounter(counter); // throws CounterNegativeError / CounterNotIntegerError / CounterOverflowError\n```\n\n### Creating a custom crypto plugin\n\n`createCryptoPlugin` wraps your HMAC and random-bytes implementations into a `CryptoPlugin` that any otplib package accepts.\n\n```typescript\nimport { createCryptoPlugin } from \"@otplib/core\";\n\nconst myCrypto = createCryptoPlugin({\n  name: \"my-crypto\",\n  hmac: async (algorithm, key, data) => {\n    // Return Uint8Array — async and sync returns are both accepted\n  },\n  randomBytes: (length) => {\n    // Return a cryptographically secure Uint8Array of the requested length\n  },\n});\n```\n\n### Creating a custom Base32 plugin\n\n`createBase32Plugin` wraps encode/decode functions into a `Base32Plugin`. Use this to bypass Base32 entirely or to integrate an alternative encoding library.\n\n```typescript\nimport { createBase32Plugin, stringToBytes, bytesToString } from \"@otplib/core\";\n\n// Example: UTF-8 passthrough (no Base32 encoding)\nconst plaintextPlugin = createBase32Plugin({\n  name: \"plaintext\",\n  encode: bytesToString,\n  decode: stringToBytes,\n});\n```\n\n### Converting secret formats\n\n`stringToBytes` and `bytesToString` convert between UTF-8 strings and `Uint8Array`. Use `stringToBytes` when you have a raw passphrase rather than a Base32-encoded secret.\n\n```typescript\nimport { stringToBytes, bytesToString } from \"@otplib/core\";\n\n// Raw passphrase → Uint8Array for use as secret bytes\nconst secretBytes = stringToBytes(\"my-raw-passphrase\");\n\n// Uint8Array → string (UTF-8 decode)\nconst str = bytesToString(secretBytes);\n```\n\n`normalizeSecret` handles the common case of accepting either a Base32 string or a `Uint8Array` and returning bytes, given a Base32 plugin.\n\n```typescript\nimport { normalizeSecret } from \"@otplib/core\";\n\nconst bytes = normalizeSecret(\"JBSWY3DPEHPK3PXP\", base32Plugin);\n// or pass Uint8Array directly — returned unchanged\nconst bytes2 = normalizeSecret(existingUint8Array);\n```\n\n### Generating a secret with explicit plugins\n\nWhen using `@otplib/core` directly (rather than the main `otplib` bundle), you must supply the crypto and Base32 plugins explicitly.\n\n```typescript\nimport { generateSecret } from \"@otplib/core\";\nimport { NodeCryptoPlugin } from \"@otplib/plugin-crypto-node\";\nimport { ScureBase32Plugin } from \"@otplib/plugin-base32-scure\";\n\nconst secret = generateSecret({\n  crypto: new NodeCryptoPlugin(),\n  base32: new ScureBase32Plugin(),\n  length: 20, // 160 bits — RFC 4226 recommendation\n});\n```\n\n## Documentation\n\nFull API reference and usage guides at [otplib.yeojz.dev](https://otplib.yeojz.dev):\n\n- [Getting Started Guide](https://otplib.yeojz.dev/guide/getting-started)\n- [Plugins Guide](https://otplib.yeojz.dev/guide/plugins)\n- [API Reference](https://otplib.yeojz.dev/api/)\n\n## Related Packages\n\n- `@otplib/hotp` - HOTP implementation (RFC 4226)\n- `@otplib/totp` - TOTP implementation (RFC 6238)\n- `@otplib/plugin-crypto-node` - Node.js crypto plugin\n- `@otplib/plugin-crypto-web` - Web Crypto API plugin\n- `@otplib/plugin-crypto-noble` - Noble hashes crypto plugin\n- `@otplib/plugin-base32-scure` - Base32 plugin using @scure/base\n\n## License\n\n[MIT](./LICENSE)","users":{}}