Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

totp-generator

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

totp-generator

Generate TOTP tokens from key

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
262K
increased by15.44%
Maintainers
1
Weekly downloads
 
Created

What is totp-generator?

The totp-generator npm package is used to generate Time-based One-Time Passwords (TOTP). This is commonly used for two-factor authentication (2FA) to enhance security by providing a second layer of authentication.

What are totp-generator's main functionalities?

Generate TOTP

This feature allows you to generate a TOTP using a shared secret. The generated token is time-based and changes every 30 seconds by default.

const totp = require('totp-generator');
const secret = 'JBSWY3DPEHPK3PXP';
const token = totp(secret);
console.log(token);

Custom Time Step

This feature allows you to customize the time step for the TOTP generation. In this example, the token changes every 60 seconds instead of the default 30 seconds.

const totp = require('totp-generator');
const secret = 'JBSWY3DPEHPK3PXP';
const token = totp(secret, { time: 60 });
console.log(token);

Custom Digits

This feature allows you to customize the number of digits in the generated TOTP. In this example, the token has 8 digits instead of the default 6 digits.

const totp = require('totp-generator');
const secret = 'JBSWY3DPEHPK3PXP';
const token = totp(secret, { digits: 8 });
console.log(token);

Other packages similar to totp-generator

Keywords

FAQs

Package last updated on 01 Feb 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc