Socket
Socket
Sign inDemoInstall

@types/authenticator

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/authenticator

TypeScript definitions for authenticator


Version published
Weekly downloads
18K
decreased by-2.03%
Maintainers
1
Install size
5.42 kB
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/authenticator

Summary

This package contains type definitions for authenticator (https://git.coolaj86.com/coolaj86/node-authenticator.js#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/authenticator.

index.d.ts

/**
 * Object returned by `verifyToken()`.
 * delta: number
 */
export interface VerifyResult {
    delta: number;
}

/**
 * Generates a 32-character (160-bit) base32 key.
 */
export function generateKey(): string;

/**
 * Generates a 6-digit (20-bit) decimal time-based token.
 * @param formattedKey 32-character (160-bit) base32 key.
 */
export function generateToken(formattedKey: string): string;

/**
 * Generates an `OTPAUTH://` scheme URI for QR Code generation.
 * @param formattedKey 32-character (160-bit) base32 key.
 * @param accountName User account e.g. user@gmail.com
 * @param issuer The provider or service this account is associated with, URL-
 * encoded according to RFC 3986
 * @param algorithm The algorithm may have the values:
 * - SHA1 (default)
 * - SHA256
 * - SHA512
 * @param digits The digits parameter may have the values 6 or 8, and determines
 * how long of a one-time passcode to display to the user.
 * @param period The amount of time the TOTP code will be valid for, in seconds.
 */
export function generateTotpUri(
    formattedKey: string,
    accountName: string,
    issuer: string,
    algorithm: string,
    digits: number,
    period: number,
): string;

/**
 * Validates a time-based token within a +/- 30 second (90 seconds) window
 * returns `null` on failure or an object such as `{ delta: 0 }` on success.
 * @param formattedKey 32-character (160-bit) base32 key.
 * @param formattedToken 6-digit (20-bit) decimal time-based token.
 */
export function verifyToken(formattedKey: string, formattedToken: string): VerifyResult | null;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:04 GMT
  • Dependencies: none

Credits

These definitions were written by .

FAQs

Last updated on 06 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc