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

@thomaschaplin/image-to-totp

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thomaschaplin/image-to-totp

image-to-totp converts qr code images to totp codes

  • 2.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source
logo

image-to-totp

image-to-totp is a library to generate totp codes from a QR code image with a single API.

Usage

npm install @thomaschaplin/image-to-totp

Example Usage

Find full example here but see the below code snippet

example-qr-code
src/
  images/
    example1.png
    example2.png
import { imageToTotp } from "@thomaschaplin/image-to-totp";
import * as path from "path";

const example = async (account: string) => {
  const projectBaseFolder = path.join(__dirname, "../");
  const imagesFolder = path.join(projectBaseFolder, "src/images");
  const totp = await imageToTotp(`${imagesFolder}/${account}.png`);
  console.log(`Account: ${account} - ${totp}`);
};

example("example1"); // Account: example1 - 034624
example("example2"); // Account: example2 - 084841

Description

This repository allows you to take a QR code image and turn it into a TOTP code.

This project uses:

Setup

Make sure you have Node.js installed on your machine

Development

Installation
  • Clone this repository git clone git@github.com:thomaschaplin/image-to-totp.git
  • Change directory cd image-to-totp
  • Install the dependencies npm install
  • Transpile the code npm run build or npm run watch
Tests
  • Run the tests npm test
  • Run the tests with coverage npm run test:coverage
  • Run the tests with mutation testing npm run test:mutation

Image by mohamed Hassan from Pixabay

Keywords

FAQs

Package last updated on 25 Nov 2021

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