{"_id":"@aegisjsproject/otp","_rev":"3-46ca8bc5491ed68c073d04b6b660677b","name":"@aegisjsproject/otp","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@aegisjsproject/otp","version":"1.0.0","keywords":["otp","totp","crypto"],"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","_id":"@aegisjsproject/otp@1.0.0","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"homepage":"https://github.com/AegisJSProject/otp#readme","bugs":{"url":"https://github.com/AegisJSProject/otp/issues"},"dist":{"shasum":"d012aeb8363d1d3cdbeb1364e23db81c63f3e0c7","tarball":"https://registry.npmjs.org/@aegisjsproject/otp/-/otp-1.0.0.tgz","fileCount":10,"integrity":"sha512-eqVL44tvv68hdiN1bVgFPvborFQXV1dSXSNfW/rGtnP+BYjlyyZMl7Kbva/7pUHMwxyYjCue5N/tYo4rfwJN7A==","signatures":[{"sig":"MEUCIQDNo8S/D4+VCNG9eSk3Knclgo1qdUCDaDYwc2G0xr9wAgIgNobo+cRreh+L7L1ExDDOJj3/33AOqcRvJodWtYsMlno=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fotp@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46891},"main":"./otp.cjs","type":"module","unpkg":"./otp.min.js","module":"./otp.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":"./otp.js","require":"./otp.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"}},"funding":[{"url":"https://liberapay.com/shgysk8zer0","type":"librepay"},{"url":"https://github.com/sponsors/shgysk8zer0","type":"github"}],"gitHead":"7053d54e417d1949d48f03e7f1c984b57b29706b","private":false,"scripts":{"test":"npm run lint:js && npm run run:tests","build":"npm run build:js","clean":"rm -f ./*.cjs","fix:js":"eslint . --fix","lint:js":"eslint .","prepare":"npm test && npm run build","build:js":"npm run clean && rollup -c rollup.config.js","run:tests":"node --test","preversion":"npm test && npm run build","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock"},"_npmUser":{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"},"repository":{"url":"git+https://github.com/AegisJSProject/otp.git","type":"git"},"_npmVersion":"10.1.0","description":"An OTP library written using the `crypto` API","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.24.0","rollup":"^4.40.0","@rollup/plugin-terser":"^0.4.4","@shgysk8zer0/eslint-config":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/otp_1.0.0_1744657663002_0.5138681169318771","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aegisjsproject/otp","version":"1.0.1","keywords":["otp","totp","crypto"],"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","_id":"@aegisjsproject/otp@1.0.1","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"homepage":"https://github.com/AegisJSProject/otp#readme","bugs":{"url":"https://github.com/AegisJSProject/otp/issues"},"dist":{"shasum":"7a19eaca72315fe1f9c984f7068ba803e94b7801","tarball":"https://registry.npmjs.org/@aegisjsproject/otp/-/otp-1.0.1.tgz","fileCount":10,"integrity":"sha512-Zbvit5qgKloaaNnZ2E2hZQSGH8tmjJ2SnhD+HOfpuj+Kjrek2VnMR4//606+MfPTO/4H/n4WFEwrLeHN2HrHMA==","signatures":[{"sig":"MEQCIEvfUT+7gUrc6PpD3DohfL+iJvs1Mwpz8/zDKLPzt0RUAiBxXR4qN/lP6zxlsyeYs51SIok8XnDqoLUnSDqB7g+i3g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fotp@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54922},"main":"./otp.cjs","type":"module","unpkg":"./otp.min.js","module":"./otp.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":"./otp.js","require":"./otp.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"}},"funding":[{"url":"https://liberapay.com/shgysk8zer0","type":"librepay"},{"url":"https://github.com/sponsors/shgysk8zer0","type":"github"}],"gitHead":"ccaff0185e440e431395181181d3e27c711b5244","private":false,"scripts":{"test":"npm run lint:js && npm run run:tests","build":"npm run build:js","clean":"rm -f ./*.cjs","fix:js":"eslint . --fix","lint:js":"eslint .","prepare":"npm test && npm run build","build:js":"npm run clean && rollup -c rollup.config.js","run:tests":"node --test","preversion":"npm test && npm run build","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock"},"_npmUser":{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"},"repository":{"url":"git+https://github.com/AegisJSProject/otp.git","type":"git"},"_npmVersion":"10.1.0","description":"An OTP library written using the `crypto` API","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.24.0","rollup":"^4.40.0","@rollup/plugin-terser":"^0.4.4","@shgysk8zer0/eslint-config":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/otp_1.0.1_1744681372501_0.30764764143552314","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aegisjsproject/otp","version":"1.0.2","description":"An OTP library written using the `crypto` API","keywords":["otp","totp","crypto"],"type":"module","main":"./otp.cjs","module":"./otp.js","unpkg":"./otp.min.js","exports":{".":{"import":"./otp.js","require":"./otp.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"}},"engines":{"node":">=18.0.0"},"private":false,"scripts":{"start":"http-server -c ./http.config.js","test":"npm run lint:js && npm run run:tests","preversion":"npm test && npm run build","prepare":"npm test && npm run build","lint:js":"eslint .","fix:js":"eslint . --fix","build":"npm run build:js","run:tests":"node --test","clean":"rm -f ./*.cjs","build:js":"npm run clean && rollup -c rollup.config.js","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock"},"repository":{"type":"git","url":"git+https://github.com/AegisJSProject/otp.git"},"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","funding":[{"type":"librepay","url":"https://liberapay.com/shgysk8zer0"},{"type":"github","url":"https://github.com/sponsors/shgysk8zer0"}],"bugs":{"url":"https://github.com/AegisJSProject/otp/issues"},"homepage":"https://github.com/AegisJSProject/otp#readme","devDependencies":{"@aegisjsproject/dev-server":"^1.0.6","@aegisjsproject/http-utils":"^1.0.4","@rollup/plugin-terser":"^1.0.0","@shgysk8zer0/eslint-config":"^1.0.9","@shgysk8zer0/importmap":"^1.8.11","eslint":"^10.1.0","rollup":"^4.60.1"},"gitHead":"c2a855fafcbf9a279748d98295fa40a4d5bd19d2","_id":"@aegisjsproject/otp@1.0.2","_nodeVersion":"25.3.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-RouoTop2xFuD9tjBo8q+5lsH0a+zblK/yZRpTsZdYxugqRU9mbO/hb80BRR9CMjpCElz0RFXqWOvej8iQzNNyw==","shasum":"344aab3122fd27f27b5b3f85f0f7ddd61f3a570b","tarball":"https://registry.npmjs.org/@aegisjsproject/otp/-/otp-1.0.2.tgz","fileCount":10,"unpackedSize":58124,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fotp@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCW8P9bxchXY+tcb5yoDzfN0k+9zvOtshGKBO0WppHIXgIgdo5+734sMpPWfsTnZ+ST2YnX77Slo2k3mwieaMUmm1E="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6bb4d5c9-5310-43ae-aba4-7961291ecbbf"}},"directories":{},"maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/otp_1.0.2_1775243125037_0.8976281047885819"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-14T19:07:42.888Z","modified":"2026-04-03T19:05:25.488Z","1.0.0":"2025-04-14T19:07:43.228Z","1.0.1":"2025-04-15T01:42:52.701Z","1.0.2":"2026-04-03T19:05:25.168Z"},"bugs":{"url":"https://github.com/AegisJSProject/otp/issues"},"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","homepage":"https://github.com/AegisJSProject/otp#readme","keywords":["otp","totp","crypto"],"repository":{"type":"git","url":"git+https://github.com/AegisJSProject/otp.git"},"description":"An OTP library written using the `crypto` API","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"readme":"# `@aegisjsproject/otp`\n\nAn OTP library written using the `crypto` API\n\n[![CodeQL](https://github.com/Aegisjsproject/otp/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/Aegisjsproject/otp/actions/workflows/codeql-analysis.yml)\n![Node CI](https://github.com/Aegisjsproject/otp/workflows/Node%20CI/badge.svg)\n![Lint Code Base](https://github.com/Aegisjsproject/otp/workflows/Lint%20Code%20Base/badge.svg)\n\n[![GitHub license](https://img.shields.io/github/license/Aegisjsproject/otp.svg)](https://github.com/Aegisjsproject/otp/blob/master/LICENSE)\n[![GitHub last commit](https://img.shields.io/github/last-commit/Aegisjsproject/otp.svg)](https://github.com/Aegisjsproject/otp/commits/master)\n[![GitHub release](https://img.shields.io/github/release/Aegisjsproject/otp?logo=github)](https://github.com/Aegisjsproject/otp/releases)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/shgysk8zer0?logo=github)](https://github.com/sponsors/shgysk8zer0)\n\n[![npm](https://img.shields.io/npm/v/@aegisjsproject/otp)](https://www.npmjs.com/package/@aegisjsproject/otp)\n![node-current](https://img.shields.io/node/v/@aegisjsproject/otp)\n![npm bundle size gzipped](https://img.shields.io/bundlephobia/minzip/@aegisjsproject/otp)\n[![npm](https://img.shields.io/npm/dw/@aegisjsproject/otp?logo=npm)](https://www.npmjs.com/package/@aegisjsproject/otp)\n\n[![GitHub followers](https://img.shields.io/github/followers/AegisJSProject.svg?style=social)](https://github.com/AegisJSProject)\n![GitHub forks](https://img.shields.io/github/forks/Aegisjsproject/otp.svg?style=social)\n![GitHub stars](https://img.shields.io/github/stars/Aegisjsproject/otp.svg?style=social)\n[![Twitter Follow](https://img.shields.io/twitter/follow/shgysk8zer0.svg?style=social)](https://twitter.com/shgysk8zer0)\n\n[![Donate using Liberapay](https://img.shields.io/liberapay/receives/shgysk8zer0.svg?logo=liberapay)](https://liberapay.com/shgysk8zer0/donate \"Donate using Liberapay\")\n- - -\n\n- [Code of Conduct](./.github/CODE_OF_CONDUCT.md)\n- [Contributing](./.github/CONTRIBUTING.md)\n<!-- - [Security Policy](./.github/SECURITY.md) -->\n\n## Features\n\n* Implements RFC 6238 for TOTP generation and verification.\n* Uses the standard `Web Crypto API` for secure HMAC operations.\n* Supports SHA-1, SHA-256, and SHA-512 algorithms.\n* Provides Base32 encoding/decoding (RFC 4648 compatible).\n* Generates and parses `otpauth://totp/` URIs for easy provisioning with authenticator apps.\n* Cryptographically secure secret generation.\n* Configurable token length, time period, and time skew tolerance.\n* Pure ES Module, no external runtime dependencies for core crypto.\n\n## Installation\n\n### Using npm (for Node.js, Bundlers)\n\nInstall the package using your preferred package manager:\n\n```bash\n# Using npm\nnpm install @aegisjsproject/otp\n\n# Using yarn\nyarn add @aegisjsproject/otp\n\n# Using pnpm\npnpm add @aegisjsproject/otp\n\n# Using Git submodules\ngit submodule add https://github.com/Aegisjsproject/otp.git path/to/destination\n```\n\n### Using a CDN with [Importmap](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap)\n\n```html\n<script type=\"importmap\">\n  {\n    \"imports\": {\n      \"@aegisjsproject/otp\": \"https://unpkg.com/@aegisjsproject/otp[@vx.y.z]/otp.min.js\",\n      \"@aegisjsproject/otp/\": \"https://unpkg.com/@aegisjsproject/otp[@vx.y.z]/\"\n    }\n  }\n</script>\n```\n\n## Usage Example\n\n```js\nimport {\n    generateSecret,\n    secretToKey,\n    createOTPAuthURI,\n    generateTOTP,\n    verifyTOTP,\n    parseOTPAuthURI,\n    // other exports if needed...\n} from '@aegisjsproject/otp';\n\n// Generate the random bytes\nconst secret = generateSecret();\n\n// Create a secret key from those random bytes\nconst key = await secretToKey(secret);\n\n// Generate an `otpauth:` URI to QR encode (QR encoding not provided)\nconst uri = createOTPAuthURI({ label: 'Acme:user@example.com', issuer: 'Acme', secret });\n\n// Verify a user-provided TOTP code\nconst valid = await verifyTOTP(totpCode, key);\n```\n","readmeFilename":"README.md"}