GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - thomaschaplin/image-to-totp: 🔐 Convert QR images to TOTP codes

This repository was archived by the owner on Nov 9, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

60 Commits
60 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
assets
assets
 
 
examples
examples
 
 
src
src
 
 
.eslintignore
.eslintignore
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
.huskyrc
.huskyrc
 
 
.nvmrc
.nvmrc
 
 
.prepush.config
.prepush.config
 
 
.prettierignore
.prettierignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
jest.config.js
jest.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
prepush.sh
prepush.sh
 
 
prettier.config.js
prettier.config.js
 
 
readme.md
readme.md
 
 
release.sh
release.sh
 
 
stryker.conf.json
stryker.conf.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

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:

  • jimp
  • jsqr
  • otpauth

Setup

Make sure you have Node.js installed on your machine

Development

Installation

  • Clone this repository git clone [email protected]: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

About

🔐 Convert QR images to TOTP codes

Topics

2fa2fa-codes2factorqrcodetotp

Resources

Readme
MIT license

Code of conduct

Code of conduct
Activity

Stars

11 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.