diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index f2cec9f..df4cd68 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -30,4 +30,4 @@ jobs: - name: install wrangler run: npm i -g wrangler - name: deploy - run: wrangler pages deploy docs/dist --project-name oslo-otp --branch main \ No newline at end of file + run: wrangler pages deploy docs/dist --project-name oslo-otp --branch main diff --git a/README.md b/README.md index 2864c35..6b91417 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **Documentation: https://oauth2.oslojs.dev** -A JavaScript library for generating and verifying OTPs by [Oslo](https://oslojs.dev). +A JavaScript library for generating and verifying OTPs by [Oslo](https://oslojs.dev). Supports HMAC-based one-time passwords (HOTP) and time-based one-time passwords (TOTP) as defined in [RFC 4226](https://datatracker.ietf.org/doc/html/rfc4226) and [RFC 6238](https://datatracker.ietf.org/doc/html/rfc6238). @@ -14,7 +14,7 @@ Supports HMAC-based one-time passwords (HOTP) and time-based one-time passwords import { generateTOTP, verifyTOTP } from "@oslojs/oauth2"; const totp = generateTOTP(key, 30, 6); -const valid = verifyTOTP(totp, key, 30, 6) +const valid = verifyTOTP(totp, key, 30, 6); ``` ## Installation diff --git a/docs/pages/index.md b/docs/pages/index.md index d786771..35053cd 100644 --- a/docs/pages/index.md +++ b/docs/pages/index.md @@ -4,7 +4,7 @@ title: "@oslojs/otp documentation" # @oslojs/otp documentation -A JavaScript library for generating and verifying OTPs by [Oslo](https://oslojs.dev). +A JavaScript library for generating and verifying OTPs by [Oslo](https://oslojs.dev). Supports HMAC-based one-time passwords (HOTP) and time-based one-time passwords (TOTP) as defined in [RFC 4226](https://datatracker.ietf.org/doc/html/rfc4226) and [RFC 6238](https://datatracker.ietf.org/doc/html/rfc6238). @@ -12,12 +12,11 @@ Supports HMAC-based one-time passwords (HOTP) and time-based one-time passwords - No third-party dependencies - Fully typed - ```ts import { generateTOTP, verifyTOTP } from "@oslojs/oauth2"; const totp = generateTOTP(key, 30, 6); -const valid = verifyTOTP(totp, key, 30, 6) +const valid = verifyTOTP(totp, key, 30, 6); ``` ## Installation diff --git a/docs/pages/reference/index.md b/docs/pages/reference/index.md index 49dff3a..02705bb 100644 --- a/docs/pages/reference/index.md +++ b/docs/pages/reference/index.md @@ -6,4 +6,4 @@ title: "API reference" ## Modules -- [`main`](/reference/main) \ No newline at end of file +- [`main`](/reference/main) diff --git a/docs/pages/reference/main/KeyURI/index.md b/docs/pages/reference/main/KeyURI/index.md index 78e57c5..4a14b57 100644 --- a/docs/pages/reference/main/KeyURI/index.md +++ b/docs/pages/reference/main/KeyURI/index.md @@ -30,4 +30,4 @@ function constructor( - [`setCounter()`](/reference/main/KeyURI/setCounter) - [`setDigits()`](/reference/main/KeyURI/setDigits) - [`setPeriodInSeconds()`](/reference/main/KeyURI/etPeriodInSeconds) -- [`toString()`](/reference/main/KeyURI/toString) \ No newline at end of file +- [`toString()`](/reference/main/KeyURI/toString) diff --git a/src/hotp.ts b/src/hotp.ts index 9d0cb3d..f273a63 100644 --- a/src/hotp.ts +++ b/src/hotp.ts @@ -33,7 +33,7 @@ export function verifyHOTP(otp: string, key: Uint8Array, counter: bigint, digits } const otpChars = otp.split(""); const rawOTP = new Uint8Array(otp.length); - // Avoid TextEncoder since utf-8 characters have variable byte size + // Avoid TextEncoder since utf-8 characters have variable byte size for (let i = 0; i < rawOTP.byteLength; i++) { const digit = Number(otpChars[i]); if (!Number.isInteger(digit)) {