2.0.0 • Published 1 year ago

simple-totp v2.0.0

Weekly downloads
118
License
ISC
Repository
github
Last release
1 year ago

Build Status Coverage Status

Simple TOTP

Use this library to generate OTP passwords like Google Authenticator

import {getTOTP} from "simple-totp";

const totp = getTOTP("JBSWY3DP", "base32", Date.now(), 6); 
// {
//  totp: "012345",
//  remainingMs: 29995
// }

Also, convert base32 <=> Uint8Array

Because base32 is used to encode binary data, it uses Uint8Array as a container. There are also several helper functions to convert

import {convert} from "simple-totp";
const Hello = convert('base32', 'ascii', 'JBSWY3DP')//= 'Hello' 
const JBSWY3DP = convert('ascii', 'base32', 'Hello')//= 'JBSWY3DP' 
1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

2.0.0

1 year ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago