@jovijovi/two-fa.js
Version:
A two-factor authentication(2FA) based on HOTP & TOTP written in TypeScript
57 lines (37 loc) • 1.11 kB
Markdown
# Two-FA.js
[](https://www.npmjs.com/package/@jovijovi/two-fa.js)
[](https://github.com/jovijovi/two-fa.js)
[](https://codecov.io/gh/jovijovi/two-fa.js)
A two-factor authentication(2FA) based on HOTP & TOTP written in [TypeScript](https://www.typescriptlang.org).
## Philosophy
*:kiss: KISS. Keep it small and simple.*
## Features
- Based on HOTP/TOTP algorithm
- Get code by raw key
- Get code by encoded key
- Encode/Decode key
- Gen random key
## Development Environment
- typescript `4.7.4`
- node `v16.15.1`
- ts-node `v10.8.2`
- yarn `v1.22.19`
## Install
```shell
npm install @jovijovi/two-fa.js
```
or
```shell
yarn add @jovijovi/two-fa.js
```
## Usage
```typescript
import {twofa} from '@jovijovi/two-fa.js';
const code = twofa.GetCode(key);
console.debug("Code=", code);
```
## Roadmap
- Documents
- QR
## License
[MIT](LICENSE)