# one-time-password

> A simple library for deriving one-time passwords from a base32 key.

Latest version **0.1.6** (published 2022-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install one-time-password
pnpm add one-time-password
yarn add one-time-password
bun add one-time-password
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2022-06-22 |
| First published | 2022-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 21.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shane Davenport |
| Maintainers | binary-band |
| Keywords | security, cryptography, totp, password-safety |

## Links

- npm: https://www.npmjs.com/package/one-time-password
- npm.io page: https://npm.io/package/one-time-password

## Dependencies (3)

- [assert](https://npm.io/package/assert.md) ^2.0.0
- [buffer](https://npm.io/package/buffer.md) ^6.0.3
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.1.6 (latest) — 2022-06-22
- 0.1.4 — 2022-06-22
- 0.1.3 — 2022-06-22
- 0.1.2 — 2022-06-22
- 0.1.0 — 2022-06-22
- 0.0.2 — 2022-06-22

## README

# One-Time Password

A simple library for deriving one-time passwords from a base32 key.

## Getting Started

These instructions will give you a copy of the project up and running on
your local machine for development and testing purposes.

### Installing

Requirements:

  - Node.js
  - NPM (Node.js package manager)

Install with:

    npm install one-time-password

### How To Use

```typescript
import * as OTP from 'one-time-password';

// A base32-encoded key.
const dummyKey: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';

// Derive a 6-digit, time-based token from 'dummyKey'.
const token: string = OTP.generate(dummyKey);

// If token is valid.
console.log(OTP.verify(dummyKey, token));
```

## Built With

  - [Creative Commons](https://creativecommons.org/) - Used to choose
    the license

## Versioning

We use [Semantic Versioning](http://semver.org/) for versioning.

## Authors

  - **Billie Thompson** - *Provided README Template* -
    [PurpleBooth](https://github.com/PurpleBooth)
  - **Shane Davenport** - *Library Author* -
    [Github](https://github.com/BinaryBand)

## License

This project is licensed under the [MIT License](https://license.md/)
Creative Commons License - see the [LICENSE.md](https://license.md/) file for details.

---
_Source: https://npm.io/package/one-time-password · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
